/* ==========================================================================
   UniFluent — account & auth pages
   --------------------------------------------------------------------------
   Shared by sign-in, manage-account, manage-subscription and success;
   replaces their inline <style> blocks (extracted 2026-08, restyled to the
   dark brand). Load order: brand.css first, then this.

   These are standalone app pages (no navbar): a dark stage with an indigo
   bloom, and panels floating in the middle. The old design was a purple
   gradient with a white card — and sign-in's body was `display:flex` with
   no direction, which pinned the card left and scattered the footer links
   into the right-hand gutter on phones. Column layout fixes that for good.
   ========================================================================== */

body {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: clamp(1.5rem, 4vh, 3rem) 1.25rem;
    background:
        radial-gradient(80% 60% at 50% 0%, rgba(85, 87, 232, 0.22), transparent 70%),
        radial-gradient(70% 50% at 50% 100%, rgba(123, 63, 168, 0.16), transparent 70%),
        var(--uf-ink, #0a0a0b);
}

/* --------------------------------------------------------------------------
   Cards — the white sheet becomes an ink panel
   -------------------------------------------------------------------------- */

.container,
.success-container {
    width: 100%;
    max-width: 460px;
    background: var(--uf-ink-panel, #14141c);
    border: 1px solid var(--uf-hairline, rgba(206, 206, 215, 0.14));
    border-radius: var(--uf-radius, 20px);
    padding: clamp(1.75rem, 5vw, 3rem);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

.success-container {
    text-align: center;
}

/* Manage-account is a dashboard, not a card — let it breathe */
body.account-page .container,
.container:has(.account-grid),
.container.container--wide {
    max-width: 860px;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: clamp(1rem, 3vw, 2rem);
}

/* --------------------------------------------------------------------------
   Headers
   -------------------------------------------------------------------------- */

.header-row,
.header-top {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 0.5rem;
}

/* Manage-account: back arrow | title | language switcher in one row */
.header-top {
    justify-content: space-between;
    gap: 1rem;
}

.header-top .back-arrow {
    position: static;
}

.header-title {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.back-arrow {
    position: absolute;
    inset-inline-start: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--uf-text-dim, rgba(206, 206, 215, 0.66));
    text-decoration: none;
    font-size: 1.05rem;
    transition: background-color 0.25s var(--uf-ease, ease), color 0.25s var(--uf-ease, ease);
}

.back-arrow:hover {
    background: rgba(206, 206, 215, 0.08);
    color: var(--uf-text, #f4f4f7);
}

.header-row h1,
.header-title h1 {
    margin: 0;
    font-size: clamp(1.7rem, 4vw, 2.2rem);
}

.header {
    text-align: center;
    margin-bottom: 2rem;
}

.header p,
.header-subtitle p {
    color: var(--uf-text-dim, rgba(206, 206, 215, 0.66));
    font-size: 1rem;
    margin-top: 0.5rem;
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

.form-group {
    margin-bottom: 1.5rem;
    text-align: start;
}

.form-group label,
.form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-family: var(--uf-sans, 'Inter', sans-serif);
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--uf-text, #f4f4f7);
}

.form-group input,
.form-input {
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: var(--uf-radius-sm, 12px);
    border: 1px solid var(--uf-hairline, rgba(206, 206, 215, 0.14));
    background: rgba(206, 206, 215, 0.04);
    color: var(--uf-text, #f4f4f7);
    font-family: var(--uf-sans, 'Inter', sans-serif);
    font-size: 1rem;
    transition: border-color 0.25s var(--uf-ease, ease), background-color 0.25s var(--uf-ease, ease);
}

.form-group input::placeholder,
.form-input::placeholder {
    color: var(--uf-text-faint, rgba(206, 206, 215, 0.42));
}

.form-group input:focus,
.form-input:focus {
    outline: none;
    border-color: rgba(139, 141, 255, 0.55);
    background: rgba(139, 141, 255, 0.06);
}

.password-toggle {
    position: relative;
}

.password-toggle input {
    padding-inline-end: 3rem;
}

.password-toggle button {
    position: absolute;
    inset-inline-end: 0.4rem;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--uf-text-faint, rgba(206, 206, 215, 0.42));
    cursor: pointer;
}

.password-toggle button:hover {
    color: var(--uf-text, #f4f4f7);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.95rem 1.7rem;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--uf-indigo, #5557e8);
    color: #fff;
    font-family: var(--uf-sans, 'Inter', sans-serif);
    font-size: 0.98rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.3s var(--uf-ease, ease),
                background-color 0.3s var(--uf-ease, ease),
                box-shadow 0.3s var(--uf-ease, ease);
}

.btn:hover {
    background: #6668ff;
    transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(85, 87, 232, 0.35);
}

.btn:disabled {
    opacity: 0.45;
    cursor: default;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: rgba(206, 206, 215, 0.06);
    border-color: var(--uf-hairline, rgba(206, 206, 215, 0.14));
    color: var(--uf-text, #f4f4f7);
}

.btn-secondary:hover {
    background: rgba(206, 206, 215, 0.12);
    box-shadow: none;
}

.btn-danger {
    background: #b3372f;
}

.btn-danger:hover {
    background: #cf443b;
    box-shadow: 0 14px 34px rgba(179, 55, 47, 0.3);
}

.btn-success {
    background: #1f8a4c;
}

.btn-success:hover {
    background: #27a35b;
    box-shadow: 0 14px 34px rgba(31, 138, 76, 0.3);
}

.btn-small {
    width: auto;
    padding: 0.6rem 1.2rem;
    font-size: 0.88rem;
}

.btn-danger-outline {
    background: transparent;
    border-color: rgba(248, 134, 126, 0.4);
    color: #f8867e;
}

.btn-danger-outline:hover {
    background: rgba(248, 134, 126, 0.1);
    box-shadow: none;
}

.actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* --------------------------------------------------------------------------
   Info rows & status badges (subscription/account)
   -------------------------------------------------------------------------- */

.subscription-info,
.info-section {
    background: rgba(206, 206, 215, 0.03);
    border: 1px solid var(--uf-hairline-soft, rgba(206, 206, 215, 0.07));
    border-radius: var(--uf-radius-sm, 12px);
    padding: 1.25rem 1.4rem;
    margin-bottom: 1.5rem;
}

.info-section:last-child {
    margin-bottom: 0;
}

.info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--uf-hairline-soft, rgba(206, 206, 215, 0.07));
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-size: 0.92rem;
    color: var(--uf-text-dim, rgba(206, 206, 215, 0.66));
}

.info-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--uf-text, #f4f4f7);
    text-align: end;
}

.status-badge {
    display: inline-block;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}

.status-active { background: rgba(110, 231, 160, 0.14); color: #6ee7a0; }
.status-trial { background: rgba(139, 141, 255, 0.14); color: var(--uf-indigo-soft, #8b8dff); }
.status-cancelled,
.status-expired { background: rgba(248, 134, 126, 0.14); color: #f8867e; }
.status-none,
.status-unknown { background: rgba(206, 206, 215, 0.1); color: var(--uf-text-dim, rgba(206, 206, 215, 0.66)); }

.source-badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.source-apple { background: rgba(206, 206, 215, 0.12); color: var(--uf-text, #f4f4f7); }
.source-stripe { background: rgba(139, 141, 255, 0.14); color: var(--uf-indigo-soft, #8b8dff); }
.source-promo { background: rgba(251, 191, 110, 0.14); color: #fbbf6e; }

/* --------------------------------------------------------------------------
   Account dashboard cards
   -------------------------------------------------------------------------- */

.account-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.account-card {
    background: var(--uf-ink-panel, #14141c);
    border: 1px solid var(--uf-hairline, rgba(206, 206, 215, 0.14));
    border-radius: var(--uf-radius, 20px);
    padding: 1.5rem 1.6rem;
    transition: border-color 0.3s var(--uf-ease, ease);
}

.account-card:hover {
    border-color: rgba(139, 141, 255, 0.3);
}

.card-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 0 0 1rem;
    font-family: var(--uf-serif, 'Fraunces', serif);
    font-size: 1.25rem;
    color: var(--uf-text, #f4f4f7);
}

.card-title i {
    color: var(--uf-indigo-soft, #8b8dff);
    font-size: 1.05rem;
}

.danger-zone-card {
    border-color: rgba(248, 134, 126, 0.25);
}

.danger-zone-title {
    color: #f8867e;
}

.danger-zone-desc,
.delete-warning p {
    color: var(--uf-text-dim, rgba(206, 206, 215, 0.66));
    font-size: 0.95rem;
}

.delete-warning {
    background: rgba(248, 134, 126, 0.08);
    border: 1px solid rgba(248, 134, 126, 0.25);
    border-radius: var(--uf-radius-sm, 12px);
    padding: 1rem 1.2rem;
    margin: 1rem 0;
}

/* --------------------------------------------------------------------------
   Notices — warnings, successes, errors, app store prompt
   -------------------------------------------------------------------------- */

.warning,
.trial-warning {
    display: flex;
    gap: 0.8rem;
    align-items: flex-start;
    background: rgba(251, 191, 110, 0.08);
    border: 1px solid rgba(251, 191, 110, 0.25);
    border-radius: var(--uf-radius-sm, 12px);
    padding: 1rem 1.2rem;
    margin: 1rem 0;
    font-size: 0.95rem;
    color: rgba(224, 224, 232, 0.88);
}

.warning i,
.trial-warning i {
    color: #fbbf6e;
    margin-top: 0.15rem;
}

.success {
    display: flex;
    gap: 0.8rem;
    align-items: flex-start;
    background: rgba(110, 231, 160, 0.08);
    border: 1px solid rgba(110, 231, 160, 0.25);
    border-radius: var(--uf-radius-sm, 12px);
    padding: 1rem 1.2rem;
    margin: 1rem 0;
    font-size: 0.95rem;
    color: rgba(224, 224, 232, 0.88);
}

.success i {
    color: #6ee7a0;
}

.error-message,
.success-message {
    /* Hidden until the page's JS flips style.display to block */
    display: none;
    border-radius: var(--uf-radius-sm, 12px);
    padding: 0.9rem 1.1rem;
    margin: 1rem 0;
    font-size: 0.92rem;
}

.error-message {
    background: rgba(248, 134, 126, 0.1);
    border: 1px solid rgba(248, 134, 126, 0.3);
    color: #f8a49e;
}

.success-message {
    background: rgba(110, 231, 160, 0.1);
    border: 1px solid rgba(110, 231, 160, 0.3);
    color: #8ceeb4;
}

.app-notice {
    background: rgba(85, 87, 232, 0.09);
    border: 1px solid rgba(139, 141, 255, 0.2);
    border-radius: var(--uf-radius-sm, 12px);
    padding: 1.4rem;
    margin: 1.5rem 0;
    text-align: center;
}

.app-notice-content i {
    font-size: 1.5rem;
    color: var(--uf-indigo-soft, #8b8dff);
    margin-bottom: 0.6rem;
}

.app-notice-content h3 {
    font-size: 1.1rem;
    margin: 0 0 0.4rem;
}

.app-notice-content p {
    font-size: 0.92rem;
    color: var(--uf-text-dim, rgba(206, 206, 215, 0.66));
    margin: 0 0 1rem;
}

.app-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.btn-app-store,
.btn-google-play {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.4rem;
    border-radius: 999px;
    background: var(--uf-paper, #ceced7);
    color: #101014;
    font-family: var(--uf-sans, 'Inter', sans-serif);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.3s var(--uf-ease, ease), background-color 0.3s var(--uf-ease, ease);
}

.btn-app-store:hover,
.btn-google-play:hover {
    background: #fff;
    transform: translateY(-2px);
}

.apple-info {
    background: rgba(206, 206, 215, 0.04);
    border: 1px solid var(--uf-hairline-soft, rgba(206, 206, 215, 0.07));
    border-radius: var(--uf-radius-sm, 12px);
    padding: 1.2rem 1.4rem;
    margin: 1rem 0;
    text-align: start;
}

.apple-info h4 {
    margin: 0 0 0.5rem;
    font-family: var(--uf-sans, 'Inter', sans-serif);
    font-size: 1rem;
    color: var(--uf-text, #f4f4f7);
}

.apple-info p,
.apple-info li {
    font-size: 0.92rem;
    color: var(--uf-text-dim, rgba(206, 206, 215, 0.66));
}

.apple-info ol {
    margin: 0.5rem 0;
    padding-inline-start: 1.4rem;
}

/* --------------------------------------------------------------------------
   Success page
   -------------------------------------------------------------------------- */

.success-icon {
    display: inline-grid;
    place-items: center;
    width: 74px;
    height: 74px;
    border-radius: 50%;
    background: rgba(110, 231, 160, 0.12);
    border: 1px solid rgba(110, 231, 160, 0.35);
    color: #6ee7a0;
    font-size: 2rem;
    margin-bottom: 1.25rem;
}

.success-container h1 {
    font-size: clamp(1.7rem, 4vw, 2.2rem);
    margin-bottom: 0.75rem;
}

.success-container p {
    color: var(--uf-text-dim, rgba(206, 206, 215, 0.66));
    margin-bottom: 1rem;
    line-height: 1.65;
}

.refresh-notice {
    font-size: 0.88rem;
    color: var(--uf-text-faint, rgba(206, 206, 215, 0.42));
}

.features {
    text-align: start;
    background: rgba(206, 206, 215, 0.03);
    border: 1px solid var(--uf-hairline-soft, rgba(206, 206, 215, 0.07));
    border-radius: var(--uf-radius-sm, 12px);
    padding: 1.4rem 1.6rem;
    margin: 1.5rem 0;
}

.features h3 {
    font-size: 1.05rem;
    margin: 0 0 0.8rem;
}

.features ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.features li {
    position: relative;
    padding-inline-start: 1.6rem;
    margin-bottom: 0.55rem;
    font-size: 0.95rem;
    color: rgba(224, 224, 232, 0.88);
}

.features li:before {
    content: '✓';
    position: absolute;
    inset-inline-start: 0;
    color: #6ee7a0;
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   Misc shared bits
   -------------------------------------------------------------------------- */

.divider {
    position: relative;
    text-align: center;
    margin: 1.5rem 0;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--uf-hairline-soft, rgba(206, 206, 215, 0.07));
}

.divider span {
    position: relative;
    padding: 0 1rem;
    background: var(--uf-ink-panel, #14141c);
    font-size: 0.85rem;
    color: var(--uf-text-faint, rgba(206, 206, 215, 0.42));
}

.forgot-password,
.back-to-home {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.92rem;
}

.forgot-password a,
.back-to-home a {
    color: var(--uf-indigo-soft, #8b8dff);
    text-decoration: none;
}

.forgot-password a:hover,
.back-to-home a:hover {
    text-decoration: underline;
}

.loading {
    display: none;
    text-align: center;
    padding: 1rem 0;
}

.spinner {
    display: inline-block;
    width: 26px;
    height: 26px;
    border: 3px solid rgba(206, 206, 215, 0.15);
    border-top-color: var(--uf-indigo-soft, #8b8dff);
    border-radius: 50%;
    animation: uf-spin 0.8s linear infinite;
}

@keyframes uf-spin {
    to { transform: rotate(360deg); }
}

/* --------------------------------------------------------------------------
   Modals (manage-account)
   -------------------------------------------------------------------------- */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(5, 5, 8, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.modal.active,
.modal[style*="display: flex"] {
    display: flex;
}

.modal-content {
    width: 100%;
    max-width: 440px;
    background: var(--uf-ink-panel, #14141c);
    border: 1px solid var(--uf-hairline, rgba(206, 206, 215, 0.14));
    border-radius: var(--uf-radius, 20px);
    padding: 1.75rem;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.modal h3,
.modal-title {
    margin: 0 0 0.75rem;
    font-size: 1.25rem;
}

.modal p {
    color: var(--uf-text-dim, rgba(206, 206, 215, 0.66));
    font-size: 0.95rem;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.modal-close {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--uf-text-dim, rgba(206, 206, 215, 0.66));
    font-size: 1.1rem;
    cursor: pointer;
}

.modal-close:hover {
    background: rgba(206, 206, 215, 0.08);
    color: var(--uf-text, #f4f4f7);
}

.modal-buttons,
.modal-footer {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.modal-buttons .btn,
.btn-modal {
    flex: 1;
    width: auto;
}

.btn-modal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.4rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-family: var(--uf-sans, 'Inter', sans-serif);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.25s var(--uf-ease, ease);
}

.btn-modal-primary {
    background: var(--uf-indigo, #5557e8);
    color: #fff;
}

.btn-modal-primary:hover {
    background: #6668ff;
}

.btn-modal-secondary {
    background: rgba(206, 206, 215, 0.06);
    border-color: var(--uf-hairline, rgba(206, 206, 215, 0.14));
    color: var(--uf-text, #f4f4f7);
}

.btn-modal-secondary:hover {
    background: rgba(206, 206, 215, 0.12);
}

/* --------------------------------------------------------------------------
   Language switcher (manage-account reuses the navbar component classes)
   -------------------------------------------------------------------------- */

.lang-switcher {
    position: relative;
}

.lang-switcher-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--uf-hairline, rgba(206, 206, 215, 0.14));
    background: rgba(206, 206, 215, 0.05);
    color: var(--uf-text, #f4f4f7);
    font-size: 0.88rem;
    cursor: pointer;
}

.lang-switcher-btn:hover {
    background: rgba(206, 206, 215, 0.1);
}

.lang-switcher .lang-dropdown {
    display: none;
    position: absolute;
    inset-inline-end: 0;
    top: calc(100% + 8px);
    min-width: 180px;
    max-height: 320px;
    overflow-y: auto;
    background: var(--uf-ink-panel, #14141c);
    border: 1px solid var(--uf-hairline, rgba(206, 206, 215, 0.14));
    border-radius: var(--uf-radius-sm, 12px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55);
    z-index: 100;
    padding: 0.4rem;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.8rem;
    border-radius: 8px;
    font-size: 0.9rem;
    color: rgba(224, 224, 232, 0.88);
    cursor: pointer;
}

.lang-option:hover {
    background: rgba(206, 206, 215, 0.07);
}

.lang-option.active {
    background: rgba(85, 87, 232, 0.16);
    color: #fff;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 560px) {
    body {
        padding: 1rem;
        justify-content: flex-start;
    }

    .container,
    .success-container {
        padding: 1.5rem 1.25rem;
    }

    .modal-buttons,
    .modal-footer {
        flex-direction: column;
    }

    .info-row {
        flex-wrap: wrap;
    }

    .info-value {
        text-align: start;
    }
}
