/* Support chat — extends signin.css (stars, nav, typography) */

.support-wrap {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 640px;
    margin: 0 auto;
    padding: 8rem 1.25rem 1.25rem;
    padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
}

/* Fixed nav spans full width above content — let clicks pass through except the logo link. */
body.support-page nav {
    pointer-events: none;
}

body.support-page nav .logo {
    pointer-events: auto;
}

.support-header {
    margin-bottom: 1rem;
}

.support-header h1 {
    font-size: clamp(1.65rem, 4.5vw, 2rem);
    color: var(--primary);
    display: flex;
    align-items: baseline;
    gap: 0.35rem;
    text-shadow: 0 0 20px rgba(227, 223, 153, 0.35);
}

.support-header .star-icon {
    width: 10px;
    height: 10px;
    color: var(--primary);
    transform: translateY(2px);
    flex-shrink: 0;
}

.support-header p {
    margin-top: 0.25rem;
    font-size: 0.95rem;
    font-style: italic;
    color: rgba(245, 245, 245, 0.72);
}

.support-toolbar {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 2;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    transition: background 0.2s ease;
}

.icon-btn:hover {
    background: rgba(40, 40, 40, 0.9);
}

.icon-btn svg {
    width: 18px;
    height: 18px;
}

.team-banner {
    display: none;
    margin-bottom: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    background: rgba(220, 53, 69, 0.92);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 500;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    opacity: 0;
    transform: translateY(-6px);
}

.team-banner.visible {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.team-banner.banner-enter {
    animation: team-banner-in 0.42s ease forwards;
}

@keyframes team-banner-in {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 0.75rem;
    min-height: 200px;
    -webkit-overflow-scrolling: touch;
}

.msg-row {
    display: flex;
    margin-bottom: 0.75rem;
}

.msg-row.user {
    justify-content: flex-end;
}

.msg-row.assistant {
    justify-content: flex-start;
}

.bubble {
    max-width: calc(100% - 3rem);
    padding: 0.75rem 1.1rem;
    border-radius: 20px;
    font-size: 1rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

.bubble.user {
    background: linear-gradient(135deg, var(--primary) 0%, rgba(227, 223, 153, 0.88) 100%);
    color: #0d0d0d;
    box-shadow: 0 4px 14px rgba(227, 223, 153, 0.28);
}

.bubble.assistant {
    background: var(--surface);
    color: var(--text-light);
    border: 1px solid var(--border);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.bubble.team {
    background: rgba(227, 223, 153, 0.1);
    color: var(--text-light);
    border: 1px solid rgba(227, 223, 153, 0.35);
    box-shadow: 0 4px 14px rgba(227, 223, 153, 0.12);
}

.typing {
    display: flex;
    gap: 6px;
    padding: 0.75rem 1.25rem;
    align-items: center;
}

.typing span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    animation: support-bounce 0.6s ease-in-out infinite alternate;
    opacity: 0.35;
}

.typing span:nth-child(2) {
    animation-delay: 0.15s;
}

.typing span:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes support-bounce {
    to {
        opacity: 1;
        transform: scale(1.15);
    }
}

.composer {
    flex-shrink: 0;
    padding-top: 0.5rem;
}

.suggestions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
}

.suggestion-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem 1.25rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-light);
    font-family: inherit;
    font-size: 1rem;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s ease, opacity 0.35s ease;
}

.suggestion-btn:hover {
    transform: translateY(-1px);
}

.suggestion-btn .arrow {
    margin-left: auto;
    color: var(--primary);
    font-weight: 600;
}

.suggestion-btn.hidden-suggest {
    opacity: 0;
    transform: translateY(24px);
    pointer-events: none;
    height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
    border: none;
}

.suggestion-btn.show-suggest {
    opacity: 1;
    transform: translateY(0);
}

.feedback-prompt {
    display: none;
    margin-bottom: 0.75rem;
    padding: 1rem;
    border-radius: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
}

.feedback-prompt.visible {
    display: block;
}

.feedback-prompt p {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    color: rgba(245, 245, 245, 0.85);
}

.fb-btns {
    display: flex;
    gap: 0.65rem;
}

.feedback-prompt button {
    flex: 1;
    padding: 0.65rem 1rem;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}

.fb-yes {
    border: none;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: #0d0d0d;
}

.fb-no {
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-light);
}

.email-capture {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    margin-bottom: 0;
    padding: 0 1rem;
    border-radius: 16px;
    background: rgba(227, 223, 153, 0.08);
    border: 1px solid transparent;
    pointer-events: none;
    transition:
        max-height 0.38s ease,
        opacity 0.32s ease,
        margin-bottom 0.38s ease,
        padding 0.38s ease,
        border-color 0.32s ease;
}

.email-capture.visible {
    max-height: 220px;
    opacity: 1;
    margin-bottom: 0.75rem;
    padding: 1rem;
    border-color: var(--border);
    pointer-events: auto;
}

.email-capture.exiting {
    max-height: 0 !important;
    opacity: 0;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-color: transparent;
    pointer-events: none;
}

.email-capture-hint {
    font-size: 0.85rem;
    color: rgba(245, 245, 245, 0.65);
    margin: 0 0 0.65rem;
}

.email-capture label {
    display: block;
    font-size: 0.9rem;
    color: rgba(245, 245, 245, 0.85);
    margin-bottom: 0.5rem;
}

.email-capture-row {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.email-capture input[type="email"] {
    flex: 1;
    min-width: 0;
    font-family: inherit;
    font-size: 1rem;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.45);
    color: var(--text-light);
}

.email-capture input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(227, 223, 153, 0.2);
}

.btn-save-email {
    flex-shrink: 0;
    padding: 0.65rem 1rem;
    border-radius: 8px;
    border: none;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: #0d0d0d;
}

.btn-save-email:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.email-status {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: rgba(245, 245, 245, 0.65);
    min-height: 1.2em;
}

.chat-identity {
    display: none;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    padding: 0.35rem 0;
    opacity: 0;
    transform: translateY(10px);
}

.chat-identity.visible {
    display: flex;
    animation: chat-identity-in 0.42s ease forwards;
}

@keyframes chat-identity-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-identity-dot {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow:
        0 0 6px rgba(227, 223, 153, 0.85),
        0 0 14px rgba(227, 223, 153, 0.45);
    animation: chat-identity-pulse 2.4s ease-in-out infinite;
}

@keyframes chat-identity-pulse {
    0%,
    100% {
        box-shadow:
            0 0 6px rgba(227, 223, 153, 0.85),
            0 0 14px rgba(227, 223, 153, 0.45);
        transform: scale(1);
    }
    50% {
        box-shadow:
            0 0 10px rgba(227, 223, 153, 1),
            0 0 22px rgba(227, 223, 153, 0.55);
        transform: scale(1.08);
    }
}

.chat-identity-prefix {
    font-size: 0.85rem;
    color: rgba(245, 245, 245, 0.5);
}

.chat-identity-email {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    text-align: left;
    line-height: 1.3;
}

.chat-identity-email:hover,
.chat-identity-email:focus-visible {
    text-decoration: underline;
    outline: none;
}

.msg-row.msg-enter .bubble {
    animation: msg-bubble-in 0.38s ease forwards;
}

@keyframes msg-bubble-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.composer-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.composer-inner input {
    flex: 1;
    font-family: inherit;
    font-size: 1rem;
    padding: 0.875rem 1.25rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-light);
    outline: none;
}

.composer-inner input::placeholder {
    color: rgba(245, 245, 245, 0.4);
}

.composer-inner input:focus {
    border-color: var(--primary);
}

.send-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    color: var(--primary);
}

.send-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.send-btn svg {
    width: 40px;
    height: 40px;
}

.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 2000;
    align-items: flex-end;
    justify-content: center;
}

.modal-backdrop.open {
    display: flex;
}

.modal-panel {
    width: 100%;
    max-width: 640px;
    max-height: 85vh;
    background: #0a0a0a;
    border: 1px solid var(--border);
    border-radius: 16px 16px 0 0;
    display: flex;
    flex-direction: column;
    animation: support-slide-up 0.25s ease;
}

@keyframes support-slide-up {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
}

.modal-head h2 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--primary);
}

.modal-head button {
    background: none;
    border: none;
    color: var(--primary);
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
}

.modal-body {
    overflow-y: auto;
    padding: 0.5rem 0 1.5rem;
}

.history-item {
    width: calc(100% - 2.5rem);
    margin: 0.35rem 1.25rem;
    padding: 0.875rem 1rem;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.06);
    text-align: left;
    color: var(--text-light);
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    font-family: inherit;
}

.history-item:hover {
    background: rgba(40, 40, 40, 0.9);
}

.history-item .chev {
    margin-left: auto;
    color: var(--primary);
}

.badge-new {
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(220, 53, 69, 0.92);
    color: #fff;
    padding: 3px 8px;
    border-radius: 999px;
    white-space: nowrap;
}

.history-meta {
    font-size: 0.8rem;
    color: rgba(245, 245, 245, 0.45);
    margin-top: 0.25rem;
}

.empty-hint {
    text-align: center;
    color: rgba(245, 245, 245, 0.45);
    padding: 2rem 1.25rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.hp-offscreen {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

@media (max-width: 768px) {
    .support-wrap {
        padding-top: 7.5rem;
    }

    .logo img {
        height: 60px;
    }
}
