/**
 * T-UX15 — beehive auth shell for /wp/wp-login.php?action=cah_otp.
 *
 * Loaded by Candide\CAH\Core\Auth\EmailOTP::enqueue_auth_styles() on
 * login_enqueue_scripts. The cah-theme is the canonical host; an estate
 * can override by overriding `cah_otp_template_path` and shipping its
 * own auth.css alongside.
 *
 * Strategy: keep WP's #login wrapper but neutralise its presentation
 * (no background, no border) so our nested .cah-auth-shell + .cah-auth-card
 * own the visual chrome. The T-G10/T-G12 inline styling at login_head:999
 * still loads but only matters for the password-admin escape hatch; our
 * .cah-auth-* selectors are higher-specificity for the cah_otp action.
 */

:root {
    --beehive-green-deep: #0F2A1F;
    --beehive-green-mid:  #1a3a2a;
    --beehive-honey:      #E8C547;
    --beehive-honey-soft: #F4D88A;
    --beehive-honey-pale: #FAEEDA;
    --beehive-honey-deep: #B8911E;
    --beehive-cream:      #F4F1E4;
    --beehive-cream-warm: #FAF7EE;
    --beehive-ink:        #0F2A1F;
    --beehive-text-primary:   #1a3a2a;
    --beehive-text-secondary: #5a6b4a;
    --beehive-text-tertiary:  #8a8475;
    --beehive-border:        rgba(26, 58, 42, 0.12);
    --beehive-border-strong: rgba(26, 58, 42, 0.25);
}

/* Override the T-G12 cream login background with the warmer beehive
   cream so the auth shell matches the rest of the redesigned surfaces. */
body.login {
    background: var(--beehive-cream-warm);
    color: var(--beehive-text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* #login holds the cah_otp form parts. Drop its inline card chrome so
   our nested .cah-auth-card owns the look. */
body.login #login {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    max-width: 480px !important;
    width: 100% !important;
}

/* WP renders an h1 above the form with the brand link — keep it sized
   but allow our hex motif inside the card to be the primary visual. */
body.login #login h1 a {
    background-image: url('/app/themes/cah-theme/assets/images/logo/candide-bee-wordmark.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    width: 200px;
    height: 64px;
    margin: 0 auto 8px;
}

/* When our auth shell is rendered, the WP `<form>` wrapper that nests
   it is just a flow container — drop borders/padding so the card has
   sole visual weight. */
body.login .cah-auth-shell,
body.login form:has(> .cah-auth-shell) {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
}

.cah-auth-shell {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 16px;
}

/* Decorative honeycomb watermark — opacity 0.04 per design-extension brief. */
.cah-auth-shell::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 18% 22%, var(--beehive-honey-pale) 0%, transparent 38%),
        radial-gradient(circle at 82% 78%, var(--beehive-honey-pale) 0%, transparent 38%);
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
}

.cah-auth-eyebrow {
    position: relative;
    z-index: 1;
    font-size: 11px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--beehive-honey-deep);
    font-weight: 500;
    margin-bottom: 14px;
}

.cah-auth-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    background: var(--beehive-cream);
    border: 0.5px solid var(--beehive-border-strong);
    border-radius: 16px;
    padding: 40px 36px 32px;
    box-shadow: 0 4px 24px rgba(15, 42, 31, 0.06);
}

.cah-auth-hex {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
}
.cah-auth-hex svg { width: 44px; height: 50px; }

.cah-auth-heading {
    font-family: 'Lora', Georgia, serif;
    font-size: 28px;
    color: var(--beehive-text-primary);
    margin: 0 0 10px;
    font-weight: 400;
    text-align: center;
    letter-spacing: -0.4px;
    line-height: 1.2;
}
.cah-auth-strap {
    font-family: 'Lora', Georgia, serif;
    font-style: italic;
    font-size: 14px;
    color: var(--beehive-text-secondary);
    text-align: center;
    margin: 0 0 28px;
    line-height: 1.5;
}

.cah-auth-form { margin: 0; }

.cah-auth-field { display: block; margin: 0 0 18px; }
.cah-auth-field label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--beehive-text-primary);
    letter-spacing: 0.02em;
    margin-bottom: 8px;
}
.cah-auth-input {
    box-sizing: border-box;
    width: 100%;
    height: 46px;
    padding: 0 14px;
    background: #fff;
    border: 1px solid var(--beehive-border-strong);
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    color: var(--beehive-ink);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.cah-auth-input:focus,
.cah-auth-input:focus-visible {
    border-color: var(--beehive-honey-deep);
    box-shadow: 0 0 0 3px rgba(184, 145, 30, 0.18);
}

/* 6-digit code grid — six individual inputs so screen readers announce
   per-digit and auto-advance works without overriding `maxlength`. */
.cah-auth-codegrid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin: 0 0 22px;
    padding: 0;
    border: none;
}
.cah-auth-codecell {
    box-sizing: border-box;
    width: 100%;
    height: 56px;
    padding: 0;
    background: #fff;
    border: 1px solid var(--beehive-border-strong);
    border-radius: 10px;
    font-family: 'Menlo', Consolas, monospace;
    font-size: 24px;
    font-weight: 500;
    color: var(--beehive-ink);
    text-align: center;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.cah-auth-codecell:focus,
.cah-auth-codecell:focus-visible {
    border-color: var(--beehive-honey-deep);
    box-shadow: 0 0 0 3px rgba(184, 145, 30, 0.18);
}

.cah-auth-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    padding: 12px 18px;
    border: 1px solid var(--beehive-green-deep);
    border-radius: 10px;
    background: var(--beehive-green-deep);
    color: var(--beehive-cream);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.cah-auth-button:hover,
.cah-auth-button:focus,
.cah-auth-button:focus-visible {
    background: var(--beehive-honey-deep);
    border-color: var(--beehive-honey-deep);
    color: var(--beehive-cream);
    outline: none;
}
.cah-auth-button--ghost {
    background: transparent;
    color: var(--beehive-green-deep);
    border-color: var(--beehive-border-strong);
    font-weight: 500;
    margin-top: 12px;
}
.cah-auth-button--ghost:hover,
.cah-auth-button--ghost:focus,
.cah-auth-button--ghost:focus-visible {
    background: var(--beehive-honey-pale);
    border-color: var(--beehive-honey-deep);
    color: var(--beehive-green-deep);
}

.cah-auth-notice {
    background: var(--beehive-honey-pale);
    border-left: 3px solid var(--beehive-honey-deep);
    padding: 12px 14px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--beehive-text-primary);
    margin: 0 0 22px;
}
.cah-auth-error {
    background: #fdf4f3;
    border-left: 3px solid #b0392a;
    padding: 12px 14px;
    border-radius: 6px;
    font-size: 13px;
    color: #6b2118;
    margin: 0 0 18px;
}

.cah-auth-foot {
    margin-top: 22px;
    text-align: center;
    font-size: 12.5px;
    color: var(--beehive-text-tertiary);
}
.cah-auth-foot a {
    color: var(--beehive-green-deep);
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px solid currentColor;
}
.cah-auth-foot a:hover,
.cah-auth-foot a:focus { color: var(--beehive-honey-deep); }

.screen-reader-text {
    border: 0;
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

@media (max-width: 480px) {
    .cah-auth-card { padding: 28px 22px 24px; }
    .cah-auth-heading { font-size: 24px; }
    .cah-auth-codecell { height: 50px; font-size: 20px; }
}
