/* Shared customer-facing page shell. See docs/PUBLIC_PAGES.md. */
html,
body {
    overscroll-behavior-y: auto;
}

.public-ticket-page {
    min-height: 100vh;
    padding: 24px;
    background: #f4f6f8;
}

.public-ticket-shell {
    width: min(100%, 960px);
    margin: 0 auto;
}

.public-ticket-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 24px;
}

.public-header-identity { min-width: 0; }
.public-header-title { margin: .25rem 0 0; font-size: 1.75rem; }
.public-header-subtitle { margin: .25rem 0 0; }
.public-header-actions { display: flex; align-items: center; gap: .75rem; }

.public-header-install {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: solid 1px #d9dde5;
    border-radius: 8px;
    background: #fff;
    color: var(--theme-color, #f2504d);
}
.public-header-install[hidden] { display: none; }
.public-header-install:hover,
.public-header-install:focus-visible { border-color: currentColor; background: #f8f9fa; }

.public-ticket-header .public-header-brand {
    color: var(--theme-color, #f2504d);
    font-size: 22px;
    font-weight: 700;
    text-decoration: none;
}

.public-ticket-language {
    display: inline-flex;
    overflow: hidden;
    border: solid 1px #d9dde5;
    border-radius: 8px;
    background: #fff;
}

.public-ticket-language button,
.public-ticket-language a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    padding: 6px 10px;
    border: 0;
    border-right: solid 1px #d9dde5;
    background: transparent;
    color: #232838;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.public-ticket-language button:last-child,
.public-ticket-language a:last-child { border-right: 0; }

.public-ticket-language button.is-active,
.public-ticket-language a.is-active {
    background: var(--theme-color, #f2504d);
    color: #fff;
}

.public-ticket-language .public-language-flag {
    display: block;
    font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1;
}

/* Shared control baseline for every customer-facing form. */
input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]),
select,
textarea {
    display: block;
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #d9dde5;
    border-radius: 8px;
    background-color: #fff;
    color: #232838;
    font: inherit;
    line-height: 1.4;
    box-sizing: border-box;
}

textarea { min-height: 92px; resize: vertical; }

input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"])::placeholder,
textarea::placeholder { color: #7b8494; opacity: 1; }

input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]):focus,
select:focus,
textarea:focus {
    border-color: var(--theme-color, #0d6efd);
    outline: 0;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--theme-color, #0d6efd) 18%, transparent);
}

input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="button"]):not([type="submit"]):not([type="reset"]):disabled,
select:disabled,
textarea:disabled {
    background-color: #eef1f4;
    color: #6c757d;
    cursor: not-allowed;
}

.public-ticket-help {
    display: grid;
    gap: 8px;
    margin-top: 18px;
    padding: 16px 18px;
    border: solid 1px #e7e9ee;
    background: #fff;
    border-radius: 8px;
    color: #232838;
}

.public-ticket-help > strong { color: #232838; font-size: 16px; }
.public-ticket-help div { display: flex; flex-wrap: wrap; gap: 10px 18px; color: #6c757d; font-size: 14px; }
.public-ticket-help a { color: var(--theme-color, #f2504d); font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }
.public-ticket-help .public-ticket-opening-hours { flex-basis: 100%; line-height: 1.55; }
.public-ticket-help .public-ticket-opening-hours strong { color: #6c757d; font-size: inherit; }

.public-ticket-product-note { margin-top: 10px; color: #8a93a3; font-size: 12px; text-align: center; }
.public-ticket-product-note a { color: inherit; text-decoration: none; }
.public-ticket-product-note a:hover { color: var(--bs-primary); text-decoration: underline; }

.public-status-card-heading { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.public-status-card-narrow { max-width: 36rem; }

.public-ticket-quotes-panel {
    border-color: #efd27a;
    background: #fff8df;
}

.public-ticket-install {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 8px;
    padding: 6px 8px 6px 10px;
    border-radius: 7px;
    background: var(--bs-primary);
    color: #fff;
    font-size: 12px;
    line-height: 1.3;
}

.public-ticket-install[hidden] { display: none; }
.public-ticket-install-copy { display: flex; align-items: baseline; gap: 6px; min-width: 0; flex: 1 1 auto; }
.public-ticket-install strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.public-ticket-install span { overflow: hidden; opacity: .88; text-overflow: ellipsis; white-space: nowrap; }
.public-ticket-install-action {
    flex: 0 0 auto;
    padding: 3px 7px;
    border: 1px solid rgba(255, 255, 255, .75);
    border-radius: 5px;
    background: transparent;
    color: #fff;
    font: inherit;
    font-weight: 700;
}
.public-ticket-install-action:hover,
.public-ticket-install-action:focus-visible { background: #fff; color: var(--bs-primary); }
.public-ticket-install-close {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    font-size: 19px;
    line-height: 22px;
}
.public-ticket-install-close:hover,
.public-ticket-install-close:focus-visible { background: rgba(255, 255, 255, .18); }

.public-ticket-hero {
    align-items: flex-start;
    flex-direction: column;
    justify-content: flex-start;
    gap: 10px;
}
.public-ticket-hero-heading {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px 12px;
    width: 100%;
    min-width: 0;
}
.public-ticket-hero-heading time {
    color: #6c757d;
    font-size: 14px;
    white-space: nowrap;
}
.public-ticket-hero > span { align-self: flex-start; }

@media (max-width: 575.98px) {
    .public-ticket-page { padding: 14px; }
    .public-ticket-header { align-items: flex-start; }
    .public-header-title { font-size: 1.4rem; }
    .public-ticket-install-copy { overflow: hidden; }
    .public-ticket-install-copy span { display: none; }
    .public-ticket-install strong { display: block; min-width: 0; }
}
.public-ticket-translation-notice {
    margin: -4px 0 16px;
    color: #667085;
    font-size: 12px;
}

.public-ticket-message-translated {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    color: #667085;
    font-size: 12px;
}

.public-ticket-message-translated .lucide {
    width: 14px;
    height: 14px;
}

.public-ticket-message-translated button {
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-decoration: underline;
    cursor: pointer;
}

@media (max-width: 575.98px) {
    .public-ticket-message-translated { flex-wrap: wrap; }
}

.public-ticket-chat-launcher {
    position: fixed;
    z-index: 1030;
    right: max(18px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    padding: 10px 16px;
    border: 0;
    border-radius: 999px;
    background: #0b67c2;
    color: #fff;
    font-weight: 700;
    opacity: 0;
    pointer-events: none;
    transform: translate3d(0, 28px, 0);
    transition: opacity .35s ease, transform .35s cubic-bezier(.2,.8,.2,1);
}
.public-ticket-chat-launcher.is-ready { opacity: 1; pointer-events: auto; transform: translate3d(0, 0, 0); }

.btn-attention { position: relative; overflow: hidden; }
.public-ticket-chat-launcher.btn-attention { position: fixed; }
.btn-attention::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg,transparent 25%,rgba(255,255,255,.45) 50%,transparent 75%); transform: translateX(-130%); animation: shine 3s infinite; animation-play-state: paused; pointer-events: none; }
.btn-attention.is-ready::after { animation-play-state: running; }
@keyframes shine { 0%,20% { transform: translateX(-130%); } 55%,100% { transform: translateX(130%); } }

.public-ticket-chat-launcher .lucide { width: 18px; height: 18px; }
.public-ticket-chat-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 18px;
    padding: 16px 18px;
    border: 1px solid #b6d4fe;
    border-radius: 12px;
    background: #eaf4ff;
    color: #172033;
}
.public-ticket-chat-card-copy { display: flex; min-width: 0; align-items: flex-start; gap: 12px; }
.public-ticket-chat-card-copy > .lucide { flex: 0 0 auto; width: 22px; height: 22px; margin-top: 2px; color: #0b67c2; }
.public-ticket-chat-card h2 { margin: 0 0 3px; font-size: 16px; font-weight: 700; }
.public-ticket-chat-card p { margin: 0; color: #526071; font-size: 14px; }
.public-ticket-chat-card-button { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.public-ticket-chat-badge {
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 999px;
    background: #dc3545;
    color: #fff;
    font-size: 11px;
    line-height: 1;
}

.public-ticket-chat-modal .modal-content { background: #f5f7fa; }
.public-ticket-chat-modal.fade .modal-dialog { transform: translate3d(0, 100%, 0); transition: transform .3s ease-in-out; }
.public-ticket-chat-modal.show .modal-dialog { transform: translate3d(0, 0, 0); }
.public-ticket-chat-modal .modal-header { background: #fff; }
.public-ticket-chat-modal .modal-body { display: flex; min-height: 0; flex-direction: column; padding: 18px; overflow-y: auto; }
.public-ticket-chat-content { display: flex; flex: 1 0 auto; width: min(100%, 820px); min-height: 100%; margin: 0 auto; flex-direction: column; }
.public-ticket-chat-content > .public-ticket-timeline { order: 1; margin-top: auto; }
.public-ticket-chat-content > .public-ticket-translation-notice { order: 2; margin: 12px 0; }
.public-ticket-chat-content > .public-ticket-chat-composer {
    order: 3;
    position: sticky;
    bottom: -5px;
    margin: 0 -1px -18px;
    padding: 0;
    background: #f5f7fa;
}
.public-ticket-chat-composer textarea[data-message-composer-autosize] { min-height: 42px; max-height: 180px; resize: none; overflow-y: hidden; }
.public-ticket-chat-loading { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 50vh; color: #667085; }
.public-ticket-chat-thread { display: block; overflow: visible; }
.public-ticket-chat-day { width: max-content; margin: 18px auto 12px; padding: 4px 10px; border-radius: 999px; background: #e5e7eb; color: #667085; font-size: 12px; }
.public-ticket-chat-message { display: flex; justify-content: flex-start; margin-bottom: 10px; }
.public-ticket-chat-message.is-customer { justify-content: flex-end; }
.public-ticket-chat-bubble { max-width: min(78%, 680px); padding: 10px 13px; border: 1px solid #d0d5dd; border-radius: 16px 16px 16px 4px; background: #fff; overflow-wrap: anywhere; }
.public-ticket-chat-message.is-customer .public-ticket-chat-bubble { border-color: #0b67c2; border-radius: 16px 16px 4px 16px; background: #0b67c2; color: #fff; }
.public-ticket-chat-meta { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 6px; color: #667085; font-size: 11px; }
.public-ticket-chat-author { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.public-ticket-chat-time { display: block; margin-top: 5px; color: #667085; font-size: 11px; text-align: right; }
.public-ticket-chat-message.is-customer .public-ticket-chat-meta { color: rgba(255,255,255,.72); }
.public-ticket-chat-message.is-customer .public-ticket-message-translated { color: rgba(255,255,255,.78); }
.public-ticket-chat-composer .chat-compose-row { grid-template-columns: auto minmax(0,1fr) auto; }
.public-ticket-chat-composer .chat-compose-row button { width: auto; min-width: 46px; }
.public-ticket-chat-composer .chat-compose-row .message-composer-attachment-button { width: 42px; min-width: 42px; }
.public-ticket-chat-composer.is-file-dragover{outline:2px dashed var(--bs-primary);outline-offset:-4px;background:var(--bs-primary-bg-subtle)}

@media (max-width: 575.98px) {
    .public-ticket-chat-launcher { right: 14px; bottom: max(14px, env(safe-area-inset-bottom)); }
    .public-ticket-chat-card { align-items: stretch; flex-direction: column; }
    .public-ticket-chat-card-button { justify-content: center; width: 100%; }
    .public-ticket-chat-modal .modal-body { padding: 12px; }
    .public-ticket-chat-bubble { max-width: 88%; }
}

@media (prefers-reduced-motion: reduce) {
    .public-ticket-chat-launcher { transition: none; }
    .btn-attention::after { animation: none; }
}
