/* auth.css — signup, login, MFA/new-password, terms, message pages, trial-ended. */

/* === TERMS PAGE === */
.terms-page {
    padding: 3rem 2rem;
}

.terms-container {
    max-width: 800px;
    margin: 0 auto;
}

.terms-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-subtle);
}

.terms-eyebrow {
    display: inline-block;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent-terracotta);
    margin-bottom: 1rem;
}

.terms-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.terms-header .last-updated {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.terms-header .terms-intro {
    font-size: 1.0625rem;
    color: var(--text-body);
    line-height: 1.7;
    max-width: 640px;
    margin: 0 auto;
}

.terms-section {
    margin-bottom: 3rem;
}

.terms-section h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    color: var(--accent-terracotta);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-subtle);
}

.terms-section h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    color: var(--text-primary);
    margin: 2rem 0 0.75rem;
}

.terms-section h4 {
    font-family: 'Crimson Pro', serif;
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 1.25rem 0 0.5rem;
}

.terms-section p {
    font-family: 'Crimson Pro', serif;
    font-size: 1.0625rem;
    color: var(--text-body);
    line-height: 1.75;
    margin-bottom: 1rem;
}

.terms-section ul,
.terms-section ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.terms-section li {
    font-family: 'Crimson Pro', serif;
    font-size: 1.0625rem;
    color: var(--text-body);
    line-height: 1.75;
    margin-bottom: 0.5rem;
}

.terms-section a {
    color: var(--accent-terracotta);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color var(--transition-fast);
}

.terms-section a:hover {
    border-bottom-color: var(--accent-terracotta);
}

.terms-section strong {
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .terms-page {
        padding: 2rem 1rem;
    }

    .terms-header h1 {
        font-size: 1.75rem;
    }

    .terms-section h2 {
        font-size: 1.375rem;
    }
}

/* === TOS CHECKBOX === */
.tos-agree {
    margin-top: 1.5rem !important;
    margin-bottom: 1rem !important;
}

.tos-label {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-body);
    line-height: 1.5;
}

.tos-label input[type="checkbox"] {
    margin-top: 0.2rem;
    flex-shrink: 0;
    accent-color: var(--accent-terracotta);
}

.tos-label a {
    color: var(--accent-terracotta);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color var(--transition-fast);
}

.tos-label a:hover {
    border-bottom-color: var(--accent-terracotta);
}

/* === SIGNUP PAGE === */
.signup-page {
    max-width: 1000px;
    margin: 0 auto;
}

.signup-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
    min-height: 600px;
}

.signup-illustration {
    position: sticky;
    top: 12rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    background: var(--bg-paper);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    align-self: start;
}

/* Corner decorations */
.signup-illustration::before,
.signup-illustration::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    border-color: var(--accent-terracotta);
    border-style: solid;
    opacity: 0.3;
}

.signup-illustration::before {
    top: 1rem;
    left: 1rem;
    border-width: 2px 0 0 2px;
}

.signup-illustration::after {
    bottom: 1rem;
    right: 1rem;
    border-width: 0 2px 2px 0;
}

.signup-illustration > * {
    position: relative;
    z-index: 1;
}

.signup-illustration svg {
    width: 100%;
    max-width: 260px;
    height: auto;
    color: var(--accent-terracotta);
    margin-bottom: 2rem;
    opacity: 0.9;
}

.signup-illustration h2 {
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 1rem;
}

.signup-illustration p {
    color: var(--text-muted);
    text-align: center;
}

.signup-form-container {
    padding: 2rem 0;
}

.signup-form-container h1 {
    margin-bottom: 0.5rem;
}

.signup-form-container .subtitle {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.pricing-highlight {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: rgba(125, 154, 125, 0.15);
    border: 1px solid rgba(125, 154, 125, 0.4);
    border-radius: var(--radius-sm);
    color: var(--color-success);
    font-weight: 600;
    margin-bottom: 2rem;
}

.pricing-highlight--cta {
    justify-content: center;
    margin-bottom: 0.75rem;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    border-bottom: none;
}

.pricing-highlight .icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.info-bubble {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    margin-left: .25rem;
    border-radius: 999px;
    border: 1px solid var(--text-faint);
    background: var(--bg-elevated);
    color: var(--text-body);
    font: 600 .68rem/1 var(--font-mono);
    cursor: help;
    vertical-align: middle;
}

.info-bubble::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + .5rem);
    transform: translateX(-50%);
    width: min(18rem, 72vw);
    padding: .6rem .7rem;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: var(--bg-paper);
    color: var(--text-body);
    font: 400 .78rem/1.4 var(--font-body);
    text-transform: none;
    letter-spacing: 0;
    box-shadow: var(--shadow-md);
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease;
    z-index: 20;
}

/* Hover reveal only on pointer/hover-capable devices. Touch devices (which
   report hover: none) would otherwise get a "sticky hover" that lingers after
   tapping away; there they use tap-to-toggle (.is-open, set by JS). */
@media (hover: hover) {
    .info-bubble:hover::after {
        opacity: 1;
    }
}

.info-bubble:focus-visible::after,
.info-bubble.is-open::after {
    opacity: 1;
}

.signup-form {
    margin-bottom: 2rem;
}

.signup-form .btn {
    width: 100%;
    margin-top: 0.5rem;
}

.trust-signals {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-subtle);
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9375rem;
    color: var(--text-body);
}

.trust-item .icon {
    width: 20px;
    height: 20px;
    color: var(--color-success);
}

.login-link {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9375rem;
    color: var(--text-muted);
}

.login-link a {
    font-weight: 500;
}

/* === LOGIN PAGE === */
.login-page {
    max-width: 1000px;
    margin: 0 auto;
}

.login-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    min-height: 600px;
}

.login-illustration {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    background: var(--bg-paper);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

/* Corner decorations */
.login-illustration::before,
.login-illustration::after {
    content: '';
    position: absolute;
    width: 40px;
    height: 40px;
    border-color: var(--accent-terracotta);
    border-style: solid;
    opacity: 0.3;
}

.login-illustration::before {
    top: 1rem;
    left: 1rem;
    border-width: 2px 0 0 2px;
}

.login-illustration::after {
    bottom: 1rem;
    right: 1rem;
    border-width: 0 2px 2px 0;
}

.login-illustration > * {
    position: relative;
    z-index: 1;
}

.login-illustration svg {
    width: 100%;
    max-width: 260px;
    height: auto;
    color: var(--accent-terracotta);
    margin-bottom: 2rem;
    opacity: 0.9;
}

.login-illustration h2 {
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 1rem;
}

.login-illustration p {
    color: var(--text-muted);
    text-align: center;
}

.login-form-container {
    padding: 2rem 0;
}

.login-form-container h1 {
    margin-bottom: 0.5rem;
}

.login-form-container .subtitle {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.login-form {
    margin-bottom: 2rem;
}

.login-form .btn {
    width: 100%;
    margin-top: 0.5rem;
}

.login-help-text {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.login-help-text a {
    font-weight: 500;
}

.signup-link {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9375rem;
    color: var(--text-muted);
}

.signup-link a {
    font-weight: 500;
}

/* === AUTH PAGES (Challenges: New Password, MFA) === */
.auth-page {
    max-width: 600px;
    margin: 0 auto;
}

.auth-page.auth-centered {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 60vh;
    padding-top: 2rem;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-paper);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
}

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

.auth-card-header .auth-icon {
    width: 48px;
    height: 48px;
    color: var(--accent-terracotta);
    margin-bottom: 1.5rem;
}

.auth-card-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.auth-card-header p {
    color: var(--text-muted);
    font-size: 0.9375rem;
}

.auth-form {
    margin-bottom: 1.5rem;
}

.auth-form .btn {
    width: 100%;
    margin-top: 0.5rem;
}

.auth-help {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-subtle);
}

/* Form error messages */
.form-error {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(199, 91, 91, 0.1);
    border: 1px solid rgba(199, 91, 91, 0.3);
    border-radius: var(--radius-sm);
    color: var(--color-error);
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
}

.form-error .icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

/* Form info messages (non-error guidance) */
.form-info {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(100, 150, 210, 0.1);
    border: 1px solid rgba(100, 150, 210, 0.3);
    border-radius: var(--radius-sm);
    color: #7db3e0;
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
}

.form-info .icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.form-success {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: var(--radius-sm);
    color: var(--color-success);
    margin-bottom: 1.5rem;
    font-size: 0.9375rem;
}

.form-success .icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

/* MFA input */
.mfa-input {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    text-align: center;
    letter-spacing: 0.5rem;
    padding: 1rem !important;
}

.mfa-input::placeholder {
    letter-spacing: 0.25rem;
    opacity: 0.4;
}

/* Password requirements */
.password-requirements {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

.password-requirements p {
    color: var(--text-body);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

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

.password-requirements li {
    color: var(--text-muted);
    padding: 0.25rem 0;
    padding-left: 1.25rem;
    position: relative;
}

.password-requirements li::before {
    content: '\2022';
    position: absolute;
    left: 0;
    color: var(--accent-terracotta);
}

/* Legacy subscribe page support */
.subscribe-page {
    max-width: 600px;
    margin: 0 auto;
}

.subscribe-page h1 {
    text-align: center;
    margin-bottom: 1rem;
}

.subscribe-page > p {
    text-align: center;
    font-size: 1.125rem;
    margin-bottom: 3rem;
}

.subscribe-form-large {
    background: var(--bg-paper);
    border: 1px solid var(--border-subtle);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    margin: 2rem 0;
}

.subscribe-benefits {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--accent-terracotta);
}

.subscribe-benefits h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.subscribe-benefits ul {
    list-style: none;
    margin-left: 0;
    margin-bottom: 0;
}

.subscribe-benefits li {
    padding: 0.5rem 0;
    padding-left: 1.75rem;
    position: relative;
    color: var(--text-body);
}

.subscribe-benefits li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.75rem;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237d9a7d' stroke-width='3'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.privacy-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
    text-align: center;
    padding: 1.5rem;
    border-top: 1px solid var(--border-subtle);
    font-style: italic;
}

/* Inline credit-card / status icons inside the privacy footer note.
   Without an explicit size, SVGs with no intrinsic width/height fall back
   to the browser's 300×150 default and render as a giant block. */
.privacy-note .icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--text-muted);
}

/* === MESSAGE PAGES (Success, Error, Pending) === */
.message-page {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    padding: 3rem 0;
}

.message-icon {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    animation: fadeIn 0.6s ease-out;
}

.message-icon svg {
    width: 100px;
    height: 100px;
}

.message-page.success .message-icon svg {
    color: var(--color-success);
}

.message-page.error .message-icon svg {
    color: var(--color-error);
}

.message-page h1 {
    animation: fadeUp 0.6s ease-out 0.1s both;
}

.message-page > p {
    font-size: 1.125rem;
    animation: fadeUp 0.6s ease-out 0.2s both;
}

.message-tips,
.next-steps,
.help-section,
.feedback-section {
    background: var(--bg-paper);
    border: 1px solid var(--border-subtle);
    padding: 2rem;
    border-radius: var(--radius-lg);
    margin: 2.5rem 0;
    text-align: left;
    animation: fadeUp 0.6s ease-out 0.3s both;
}

.message-tips h3,
.next-steps h3,
.help-section h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
}

.error-detail {
    background: rgba(199, 91, 91, 0.15);
    color: var(--color-error);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(199, 91, 91, 0.4);
    margin: 1.5rem 0;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.875rem;
}

.small-text {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Success page celebration */
.celebration-wrapper {
    position: relative;
    display: inline-block;
}

.celebration-wrapper .celebration-confetti {
    position: absolute;
    top: -50px;
    left: -50px;
    width: 200px;
    height: 200px;
    pointer-events: none;
}

.success-checkmark-animated .circle-draw {
    animation: circleDraw 0.6s ease-out forwards;
}

.success-checkmark-animated .check-draw {
    animation: drawCheck 0.5s ease-out 0.5s forwards;
}

/* ==========================================================================
   Trial Ended (dashboard/trial_ended.html) — shown when trial/gift access ends
   Classes are .trial-ended-* prefixed so no collision; kept at global scope.
   ========================================================================== */

.trial-ended {
    max-width: 640px;
    margin: 80px auto;
    padding: 0 20px;
    text-align: center;
}
.trial-ended-hero h1 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2.4rem;
    color: var(--cream, #f4efe6);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}
.trial-ended-hero p {
    font-size: 1.1rem;
    color: var(--text-secondary, #b8b3aa);
    line-height: 1.7;
    margin-bottom: 2rem;
}
.trial-ended-card {
    background: var(--card-bg, #171615);
    border: 1px solid var(--border, #242320);
    border-radius: 12px;
    padding: 28px;
    margin-bottom: 2rem;
    text-align: left;
}
.trial-ended-card-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gold, #c9a227);
    font-weight: 600;
    margin-bottom: 14px;
}
.trial-ended-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.trial-ended-card li {
    padding: 10px 0;
    font-size: 0.95rem;
    color: var(--text-secondary, #b8b3aa);
    border-bottom: 1px solid var(--border, #242320);
}
.trial-ended-card li:last-child {
    border-bottom: none;
}
.trial-ended-card li strong {
    color: var(--cream, #f4efe6);
}
.trial-ended-cta {
    display: inline-block;
    padding: 14px 40px;
    background: var(--terracotta, #c2644b);
    color: var(--ink, #0d0c0b);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 10px;
    transition: opacity 0.2s;
    margin-bottom: 1rem;
}
.trial-ended-cta:hover {
    opacity: 0.9;
}
.trial-ended-secondary {
    display: block;
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--text-muted, #7a7670);
}
.trial-ended-secondary a {
    color: var(--terracotta, #c2644b);
    text-decoration: none;
}

/* Responsive rules for this file, distributed from the pre-split combined @media block */
@media (max-width: 1024px) {
    .signup-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .signup-illustration {
        padding: 2rem;
    }

    .signup-illustration svg {
        max-width: 180px;
    }

    .login-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .login-illustration {
        padding: 2rem;
    }

    .login-illustration svg {
        max-width: 180px;
    }

}

/* Responsive rules for this file, distributed from the pre-split combined @media block */
@media (max-width: 768px) {
    .signup-illustration {
        display: none;
    }

    .signup-form-container {
        padding: 0;
    }

    .login-illustration {
        display: none;
    }

    .login-form-container {
        padding: 0;
    }

    .auth-card {
        padding: 1.5rem;
    }

    .auth-card-header .auth-icon {
        width: 40px;
        height: 40px;
    }

    .mfa-input {
        font-size: 1.25rem;
        letter-spacing: 0.375rem;
    }

}
