/* Auth chat (login + register) — bruk sammen med history.css */

.auth-chat-page {
    max-width: 760px;
    margin: 28px auto 48px;
}

.auth-chat-card {
    border: 1px solid var(--line);
    border-radius: 24px;
    background:
        radial-gradient(circle at 8% 10%, rgba(201, 164, 92, 0.14), transparent 34%),
        linear-gradient(180deg, rgba(255, 252, 244, 0.98), rgba(244, 232, 205, 0.96));
    box-shadow: var(--shadow-soft);
    padding: 22px;
}

.auth-chat-log {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 280px;
    max-height: 420px;
    overflow-y: auto;
    padding: 8px 4px 12px;
    margin-bottom: 14px;
}

.auth-chat-msg {
    max-width: 88%;
    padding: 12px 15px;
    border-radius: 16px;
    line-height: 1.5;
    white-space: pre-wrap;
    font-size: 0.98rem;
}

.auth-chat-msg-bot {
    align-self: flex-start;
    background: rgba(14, 52, 75, 0.08);
    border: 1px solid rgba(14, 52, 75, 0.12);
    color: var(--sea-900);
}

.auth-chat-msg-user {
    align-self: flex-end;
    background: rgba(49, 93, 67, 0.12);
    border: 1px solid rgba(49, 93, 67, 0.18);
    color: var(--pine-900);
}

.auth-chat-input-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.auth-chat-input-row input[type="text"],
.auth-chat-input-row input[type="email"] {
    flex: 1;
    min-width: 0;
    margin: 0;
    border-radius: 999px;
    padding: 12px 16px;
    border: 1px solid rgba(97, 75, 43, 0.28);
    background: rgba(255, 252, 244, 0.92);
    font-size: 1rem;
}

.auth-chat-input-row button {
    flex-shrink: 0;
    border-radius: 999px;
    padding: 12px 20px;
}

.auth-picker-results {
    margin-top: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    background: rgba(255, 252, 244, 0.96);
    box-shadow: var(--shadow-soft);
}

.auth-picker-option {
    display: block;
    width: 100%;
    text-align: left;
    padding: 13px 16px;
    border: 0;
    border-bottom: 1px solid rgba(97, 75, 43, 0.12);
    background: transparent;
    cursor: pointer;
    font: inherit;
    color: var(--text);
}

.auth-picker-option:last-child {
    border-bottom: 0;
}

.auth-picker-option:hover,
.auth-picker-option:focus {
    background: rgba(201, 164, 92, 0.14);
}

.auth-picker-option strong {
    display: block;
    color: var(--sea-900);
}

.auth-picker-option span {
    display: block;
    margin-top: 3px;
    font-size: 0.88rem;
    color: var(--muted);
}

.auth-chat-footer {
    margin-top: 18px;
    text-align: center;
    color: var(--muted);
    font-size: 0.95rem;
}

.auth-chat-footer a {
    color: var(--sea-700);
    font-weight: 700;
    text-decoration: none;
}

.auth-chat-footer a:hover {
    text-decoration: underline;
}

.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.auth-modal[hidden] {
    display: none !important;
}

.auth-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 26, 38, 0.55);
    backdrop-filter: blur(2px);
}

.auth-modal-card {
    position: relative;
    width: min(100%, 440px);
    border-radius: 24px;
    padding: 26px 24px 22px;
    border: 1px solid rgba(201, 164, 92, 0.35);
    background:
        radial-gradient(circle at 10% 0%, rgba(201, 164, 92, 0.18), transparent 40%),
        linear-gradient(180deg, #fffdf7, #f4ecd8);
    box-shadow: var(--shadow);
}

.auth-modal-card h2 {
    margin: 0 0 8px;
    font-family: var(--font-serif);
    color: var(--sea-900);
    font-size: 1.45rem;
}

.auth-modal-help {
    color: var(--muted);
    margin: 0 0 12px;
    line-height: 1.45;
}

.auth-modal-card label {
    display: block;
    margin-top: 12px;
    font-weight: 700;
    color: var(--sea-900);
}

.auth-modal-card input {
    width: 100%;
    margin-top: 6px;
}

.auth-modal-error {
    color: var(--danger);
    margin: 12px 0 0;
    font-weight: 600;
}

.auth-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    flex-wrap: wrap;
}

.auth-success-link {
    color: var(--sea-700);
    font-weight: 700;
}

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

@media (max-width: 640px) {
    .auth-chat-page {
        margin-top: 16px;
    }

    .auth-chat-input-row {
        flex-direction: column;
    }

    .auth-chat-input-row button {
        width: 100%;
    }

    .archive-title-card {
        grid-template-columns: 1fr;
    }
}
