/* =================================================================
 |  WhatsApp CRM SaaS — Auth Page Stylesheet
 |  ---------------------------------------------------------------
 |  Loaded only by /auth/*.php pages. Layered on top of style.css.
 |  Defines the centered card layout (auth-page / auth-container),
 |  the auth-brand logo block, and a few demo-mode helpers.
 |
 |  Layout goals:
 |    - Centered card, max-width 440px
 |    - Vertically centered with min-height: 100vh
 |    - Soft gradient backdrop with the brand green
 |    - Mobile: full-bleed card with extra padding
 | ================================================================= */


/* -----------------------------------------------------------------
 |  Page backdrop
 | ----------------------------------------------------------------- */
.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(16, 185, 129, 0.10), transparent 60%),
        radial-gradient(900px 500px at 110% 110%, rgba(13, 148, 136, 0.08), transparent 60%),
        var(--color-bg);
}

/* -----------------------------------------------------------------
 |  Auth container — centers the card
 | ----------------------------------------------------------------- */
.auth-container {
    width: 100%;
    max-width: 440px;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* -----------------------------------------------------------------
 |  Brand block (logo + tagline)
 | ----------------------------------------------------------------- */
.auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.625rem;
    text-align: center;
    margin-bottom: 0.25rem;
}

.auth-brand-logo {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: var(--fw-bold);
    font-size: 1.25rem;
    box-shadow: 0 8px 20px -6px rgba(16, 185, 129, 0.45);
}
.auth-brand-logo svg {
    width: 26px;
    height: 26px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
}

.auth-brand-name {
    font-size: var(--fs-lg);
    font-weight: var(--fw-semibold);
    color: var(--color-text);
    letter-spacing: -0.01em;
}

.auth-brand-tagline {
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
    max-width: 32ch;
    line-height: 1.4;
}

/* -----------------------------------------------------------------
 |  Auth card
 | ----------------------------------------------------------------- */
.auth-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 1.75rem;
}

@media (max-width: 480px) {
    .auth-card { padding: 1.25rem; }
}

.auth-card-title {
    font-size: var(--fs-xl);
    font-weight: var(--fw-semibold);
    color: var(--color-text);
    margin: 0 0 0.25rem;
    letter-spacing: -0.01em;
}

.auth-card-subtitle {
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
    margin: 0 0 1.25rem;
}

/* -----------------------------------------------------------------
 |  Form helpers specific to auth pages
 | ----------------------------------------------------------------- */
.auth-form .form-group:last-of-type {
    margin-bottom: 1.25rem;
}

.auth-form-actions {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    margin-top: 0.25rem;
}

.auth-form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: -0.25rem;
    margin-bottom: 1rem;
    font-size: var(--fs-sm);
}

.auth-form-options a {
    color: var(--color-primary-darker);
    text-decoration: none;
    font-weight: var(--fw-medium);
}
.auth-form-options a:hover { text-decoration: underline; }

/* Inline error block (above the form) */
.auth-errors {
    margin-bottom: 1rem;
}
.auth-errors .alert { margin-bottom: 0.5rem; }
.auth-errors .alert:last-child { margin-bottom: 0; }

/* -----------------------------------------------------------------
 |  Footer (below the card)
 | ----------------------------------------------------------------- */
.auth-footer {
    text-align: center;
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
}
.auth-footer a {
    color: var(--color-primary-darker);
    text-decoration: none;
    font-weight: var(--fw-medium);
}
.auth-footer a:hover { text-decoration: underline; }

/* -----------------------------------------------------------------
 |  Demo hint box (only rendered when APP_DEBUG = true)
 | ----------------------------------------------------------------- */
.auth-demo-hint {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.625rem 0.875rem;
    background: var(--color-border-soft);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius);
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
    line-height: 1.5;
}
.auth-demo-hint strong {
    color: var(--color-text);
    font-weight: var(--fw-semibold);
}
.auth-demo-hint code {
    font-family: var(--font-mono);
    background: var(--color-surface);
    padding: 1px 4px;
    border-radius: 4px;
    border: 1px solid var(--color-border);
    color: var(--color-text);
    user-select: all;
}

/* -----------------------------------------------------------------
 |  Token / API key reveal box (used in forgot.php & api_keys.php)
 | ----------------------------------------------------------------- */
.auth-token-box {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.75rem 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: var(--fs-xs);
    color: var(--color-text);
    word-break: break-all;
}
.auth-token-box code {
    flex: 1 1 auto;
    min-width: 0;
    word-break: break-all;
}
.auth-token-copy {
    flex-shrink: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
    font-family: var(--font-sans);
    transition: background var(--transition-fast), color var(--transition-fast);
}
.auth-token-copy:hover {
    background: var(--color-primary-lighter);
    color: var(--color-primary-darker);
}

/* -----------------------------------------------------------------
 |  Reset link (used in forgot.php demo mode)
 | ----------------------------------------------------------------- */
.auth-reset-link {
    display: block;
    margin-top: 0.5rem;
    padding: 0.625rem 0.875rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: var(--fs-sm);
    color: var(--color-primary-darker);
    word-break: break-all;
    text-decoration: none;
}
.auth-reset-link:hover { text-decoration: underline; }

/* -----------------------------------------------------------------
 |  Mobile tweaks
 | ----------------------------------------------------------------- */
@media (max-width: 480px) {
    .auth-page { padding: 1rem 0.75rem; }
    .auth-form-options { justify-content: center; }
}
