/* ==========================================================================
   MM Studio — Auth pages (signup chooser, signup form, login, forgot,
   reset, creator step-2 profile).
   Single-column, centered, light-only. The class names map 1:1 to the
   components we'll re-implement in Nuxt:
     .mm-nav   → <AuthNav />
     .mm-page  → <AuthShell />
     .mm-card  → <AuthCard />
     .mm-foot  → <AuthFooter />
   ========================================================================== */

/* ----- Tokens ----- */
:root {
    --mm-orange: #ef5537;
    --mm-orange-hover: #d94a2e;
    --mm-orange-pressed: #c14127;

    --bg-app: #ffffff;
    --bg-subtle: #faf9f6;
    --bg-input: #ffffff;

    --border: #e5e3dd;
    --border-strong: #b9b3a8;
    --border-input: #b9b3a8;

    --text-primary: #2d2a26;
    --text-secondary: #6b6760;
    --text-tertiary: #9a958c;

    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 14px;
    --radius-pill: 999px;

    --shadow-card: 0 1px 2px rgba(22, 20, 18, 0.04);

    --font-sans: 'Open Sans', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-primary);
    background: var(--bg-app);
    -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
input, button, textarea, select { font-family: inherit; font-size: inherit; }

a { color: inherit; }

.mm-auth {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-app);
}

/* ----- Top nav ----- */
.mm-nav {
    height: 64px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
}
.mm-nav__brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}
.mm-nav__logo {
    height: 28px;
    width: auto;
    display: block;
}
.mm-nav__actions {
    display: flex;
    align-items: center;
    gap: 18px;
}
.mm-nav__hint {
    font-size: 14px;
    color: var(--text-secondary);
}
.mm-nav__cta {
    font-size: 14px;
    font-weight: 600;
    color: var(--mm-orange);
    text-decoration: none;
}
.mm-nav__cta:hover { text-decoration: underline; }

/* ----- Page shell (centered content) ----- */
.mm-page {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 56px 20px 80px;
}
.mm-card {
    width: 100%;
    max-width: 480px;
}
.mm-card--bordered {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    background: var(--bg-app);
    box-shadow: var(--shadow-card);
}

.mm-card__title {
    font-size: 28px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.015em;
    text-align: center;
    margin: 0 0 12px;
    color: var(--text-primary);
}
.mm-card__sub {
    text-align: center;
    color: var(--text-secondary);
    font-size: 14.5px;
    line-height: 1.55;
    margin: 0 0 28px;
}

/* ----- Form primitives ----- */
.mm-form { display: flex; flex-direction: column; gap: 18px; }
.mm-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.mm-field { position: relative; }
.mm-field__control { position: relative; }
.mm-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.mm-input {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    font-size: 15px;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.mm-input::placeholder { color: var(--text-tertiary); }
.mm-input:focus {
    border-color: var(--mm-orange);
    box-shadow: 0 0 0 1px var(--mm-orange);
}
.mm-input:disabled { background: var(--bg-subtle); color: var(--text-tertiary); }

.mm-field--icon .mm-input { padding-right: 48px; }
.mm-field__eye {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-tertiary);
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    cursor: pointer;
}
.mm-field__eye:hover { color: var(--text-primary); background: var(--bg-subtle); }

.mm-hint {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-top: 6px;
}
.mm-error {
    font-size: 13px;
    color: var(--mm-orange-pressed);
    margin-top: 6px;
}

/* Honeypot */
.mm-honeypot {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
}

/* Row + checkbox */
.mm-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}
.mm-checkbox {
    display: inline-flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    line-height: 1.45;
}
.mm-checkbox input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.mm-checkbox__box {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1.5px solid var(--border-strong);
    background: var(--bg-input);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    margin-top: 1px;
    transition: all 0.15s;
}
.mm-checkbox input:checked + .mm-checkbox__box {
    background: var(--mm-orange);
    border-color: var(--mm-orange);
}
.mm-checkbox input:checked + .mm-checkbox__box::after {
    content: '';
    width: 10px;
    height: 6px;
    border-left: 2px solid white;
    border-bottom: 2px solid white;
    transform: rotate(-45deg) translate(1px, -1px);
}

/* Primary button (pill, brand) */
.mm-btn {
    height: 52px;
    width: 100%;
    padding: 0 24px;
    background: var(--mm-orange);
    color: white;
    border: none;
    border-radius: var(--radius-pill);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.01em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    transition: background 0.15s, transform 0.06s;
}
.mm-btn:hover { background: var(--mm-orange-hover); }
.mm-btn:active { background: var(--mm-orange-pressed); transform: translateY(1px); }
.mm-btn--secondary {
    background: transparent;
    color: var(--mm-orange);
    border: 1px solid var(--mm-orange);
}
.mm-btn--secondary:hover { background: rgba(239, 85, 55, 0.06); color: var(--mm-orange-hover); border-color: var(--mm-orange-hover); }
.mm-btn--ghost {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-strong);
}
.mm-btn--ghost:hover { background: var(--bg-subtle); }

.mm-link {
    color: var(--mm-orange);
    text-decoration: none;
    font-weight: 600;
}
.mm-link:hover { text-decoration: underline; }

.mm-foot-note {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    margin: 18px 0 0;
    line-height: 1.55;
}

/* ----- Social buttons (pill style, side-by-side on signup, stacked on login) ----- */
.mm-socials {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-bottom: 24px;
}
.mm-socials--stacked {
    grid-template-columns: 1fr;
}
.mm-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 52px;
    padding: 0 18px;
    border: 1px solid var(--border-strong);
    background: var(--bg-input);
    color: var(--text-primary);
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s;
}
.mm-social:hover { background: var(--bg-subtle); }
.mm-social svg { flex-shrink: 0; }
.mm-social--label-hidden {
    /* Used on narrow screens: collapse the text and just show the brand mark. */
}

/* ----- "or" divider ----- */
.mm-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 24px 0;
    color: var(--text-tertiary);
    font-size: 14px;
    position: relative;
}
.mm-divider::before,
.mm-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}
.mm-divider span { padding: 0 16px; }

/* ----- Flash messages ----- */
.mm-flash {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    margin-bottom: 18px;
    background: rgba(239, 85, 55, 0.08);
    border: 1px solid rgba(239, 85, 55, 0.2);
    border-radius: var(--radius-md);
    font-size: 13.5px;
    color: var(--mm-orange-pressed);
}
.mm-flash a { color: inherit; text-decoration: underline; font-weight: 600; }
.mm-flash__icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    margin-top: 2px;
}
/* CodeIgniter flashdata is wrapped in .alert markup we already passed
   through; flatten it so our flash chrome owns the look. */
.mm-flash .alert {
    background: transparent !important;
    color: inherit !important;
    padding: 0;
    margin: 0;
    border: none;
}

/* reCAPTCHA v3 floating badge — hidden, branding handled by inline notice */
.grecaptcha-badge { visibility: hidden !important; }
.mm-recaptcha-notice {
    margin-top: 18px;
    font-size: 12px;
    color: var(--text-tertiary);
    text-align: center;
}
.mm-recaptcha-notice a {
    color: var(--text-secondary);
    text-decoration: underline;
    text-decoration-color: var(--border);
}

/* ----- Footer ----- */
.mm-foot {
    flex-shrink: 0;
    border-top: 1px solid var(--border);
    padding: 18px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: var(--text-tertiary);
}
.mm-foot__links { display: flex; gap: 18px; }
.mm-foot__links a { color: var(--text-secondary); text-decoration: none; }
.mm-foot__links a:hover { color: var(--text-primary); }

/* ----- Dark mode ---------------------------------------------------------
 * Auth pages don't go through layouts/main.php, so the global dark-mode.css
 * tokens (--mm-*) aren't in scope for the auth-local tokens defined at the
 * top of this file (--bg-app, --text-primary, --border, etc.). Redefining
 * them under html.theme-dark flips the whole auth shell — card surface,
 * inputs, dividers, footer, social pills — to dark in one place.
 *
 * The dark-mode head partial loads dark-mode.css AFTER auth.css, so the
 * .mm-theme-toggle styles + the global body bg are already handled there.
 * This block only owns the auth-local token mapping.
 */
html.theme-dark {
    --bg-app:        #121212;
    --bg-subtle:     #232325;
    --bg-input:      #1f1f22;

    --border:        rgba(255, 255, 255, 0.12);
    --border-strong: rgba(255, 255, 255, 0.22);
    --border-input:  rgba(255, 255, 255, 0.22);

    --text-primary:   rgba(255, 255, 255, 0.87);
    --text-secondary: rgba(255, 255, 255, 0.60);
    --text-tertiary:  rgba(255, 255, 255, 0.40);

    --shadow-card:  0 1px 2px rgba(0, 0, 0, 0.5);
}
/* The bordered card sits flush with the page (light mode keeps it at
 * --bg-app and reads as a card purely via its border) — mirror that on
 * dark so it isn't a separate grey slab, especially on mobile where the
 * border is dropped entirely. */
html.theme-dark .mm-card--bordered {
    background: var(--bg-app);
    border-color: var(--border);
}
/* Autofill — Chrome paints its own background otherwise */
html.theme-dark .mm-input:-webkit-autofill,
html.theme-dark .mm-input:-webkit-autofill:hover,
html.theme-dark .mm-input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--text-primary);
    -webkit-box-shadow: 0 0 0 1000px var(--bg-input) inset;
    caret-color: var(--text-primary);
}
/* Social buttons are <a> elements, so dark-mode.css's blanket
 * `html.theme-dark a:not(.btn)` rule (0,2,2, loaded after this file)
 * repaints their label brand-orange and out-specifies a plain
 * `.mm-social` rule. The labels are button text, not links — pin them
 * (incl. hover/focus) back to the primary text colour with !important
 * so the cross-file blanket rule can't win. */
html.theme-dark .mm-social,
html.theme-dark .mm-social:hover,
html.theme-dark .mm-social:focus {
    color: var(--text-primary) !important;
}
/* The reCAPTCHA notice's Privacy/Terms links — same `html.theme-dark a`
 * brand-orange override. Keep them legible white on the dark shell. */
html.theme-dark .mm-recaptcha-notice a {
    color: var(--text-primary);
}

/* ----- Mobile ----- */
@media (max-width: 600px) {
    .mm-nav { padding: 0 16px; height: 56px; }
    .mm-nav__hint { display: none; }
    .mm-page { padding: 24px 16px 48px; }
    .mm-card--bordered {
        border: none;
        padding: 0;
        box-shadow: none;
    }
    .mm-card__title { font-size: 26px; }
    /* Inputs at 16px font on mobile prevents iOS auto-zoom on focus */
    .mm-input { font-size: 16px; }
    .mm-foot {
        padding: 16px;
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
}
