/* Auth pages — split layout */
.auth-page {
    font-family: var(--mm-font, 'Rubik', system-ui, sans-serif);
    margin: 0;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.auth-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

.auth-brand-panel {
    background: linear-gradient(145deg, #0c1222 0%, #134e4a 50%, #0f766e 100%);
    color: #fff;
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.auth-brand-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 80%, rgba(255,255,255,0.08) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(94,234,212,0.12) 0%, transparent 40%);
    pointer-events: none;
}

.auth-brand-panel--image {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.auth-brand-panel--image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--auth-overlay, rgba(12, 18, 34, 0.65));
    pointer-events: none;
    z-index: 0;
}

.auth-brand-panel--image::before {
    z-index: 1;
    opacity: 0.35;
}

.auth-brand-inner { position: relative; z-index: 1; }

.auth-logo {
    display: flex; align-items: center; gap: 14px;
    margin-bottom: 48px;
}

.auth-logo-mark {
    width: 48px; height: 48px; border-radius: 14px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    display: grid; place-items: center;
    font-size: 22px; font-weight: 700;
    border: 1px solid rgba(255,255,255,0.2);
}

.auth-logo-text { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }

.auth-logo-img {
    max-height: 52px;
    max-width: 220px;
    object-fit: contain;
    display: block;
}

.auth-headline {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 700; letter-spacing: -0.03em;
    line-height: 1.2; margin: 0 0 16px;
    max-width: 400px;
}

.auth-tagline {
    font-size: 16px; line-height: 1.6;
    color: rgba(255,255,255,0.75);
    max-width: 380px; margin: 0;
}

.auth-features {
    list-style: none; padding: 0; margin: 40px 0 0;
    display: flex; flex-direction: column; gap: 14px;
}

.auth-features li {
    display: flex; align-items: center; gap: 12px;
    font-size: 14px; color: rgba(255,255,255,0.85);
}

.auth-features li::before {
    content: '✓';
    width: 24px; height: 24px; border-radius: 999px;
    background: rgba(255,255,255,0.12);
    display: grid; place-items: center;
    font-size: 12px; font-weight: 700; flex-shrink: 0;
}

.auth-brand-foot {
    position: relative; z-index: 1;
    font-size: 13px; color: rgba(255,255,255,0.5);
}

.auth-main-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    background: var(--mm-bg, #f1f5f9);
}

.auth-main-inner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 420px;
}

.auth-main-inner:has(.auth-card-wide) {
    max-width: 560px;
}

.auth-card {
    background: #fff;
    border-radius: var(--mm-radius-lg, 16px);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--mm-shadow-lg);
    border: 1px solid var(--mm-border, #e2e8f0);
}

.auth-card-wide { max-width: 560px; }

.auth-card h1 {
    margin: 0 0 6px;
    font-size: 1.5rem; font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--mm-text, #0f172a);
}

.auth-sub {
    color: var(--mm-text-muted, #64748b);
    margin: 0 0 28px;
    font-size: 14px;
}

.auth-card label {
    display: block;
    margin: 0 0 16px;
    font-size: 13px; font-weight: 600;
    color: var(--mm-text-secondary, #334155);
}

.auth-card input:not([type="checkbox"]):not([type="radio"]) {
    display: block; width: 100%; margin-top: 6px;
    padding: 11px 14px;
    font-family: inherit; font-size: 14px;
    border: 1px solid var(--mm-border-strong, #cbd5e1);
    border-radius: var(--mm-radius-sm, 8px);
    box-sizing: border-box;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-card input:not([type="checkbox"]):not([type="radio"]):focus {
    outline: none;
    border-color: var(--mm-primary, #0f766e);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.auth-card .mmct-btn {
    width: 100%;
    margin-top: 8px;
    padding: 12px 18px;
}

.auth-links {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--mm-border, #e2e8f0);
    font-size: 14px;
    display: flex; flex-direction: column; gap: 10px;
}

.auth-links a {
    color: var(--mm-primary, #0f766e);
    text-decoration: none; font-weight: 500;
}

.auth-links a:hover { text-decoration: underline; }

.auth-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
}

.auth-form-grid label {
    font-size: 13px; font-weight: 600;
    display: flex; flex-direction: column; gap: 6px;
    margin: 0;
}

.auth-form-grid label.full { grid-column: 1 / -1; }

.auth-form-grid input,
.auth-form-grid select,
.auth-form-grid textarea {
    font: inherit; padding: 10px 12px;
    border: 1px solid var(--mm-border-strong, #cbd5e1);
    border-radius: var(--mm-radius-sm, 8px);
    margin-top: 0;
}

.auth-check {
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 10px !important;
    font-weight: 400 !important;
    line-height: 1.5;
    cursor: pointer;
    margin-top: 4px !important;
}

.auth-check input[type="checkbox"] {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
    padding: 0;
    border: none;
    accent-color: var(--mm-primary, #0f766e);
    cursor: pointer;
}

.auth-check span {
    flex: 1;
    min-width: 0;
}

.auth-check a {
    color: var(--mm-primary, #0f766e);
    font-weight: 500;
    text-decoration: underline;
}

.auth-check a:hover {
    color: var(--mm-primary-dark, #115e59);
}

.auth-foot { margin-top: 16px; font-size: 14px; }

.auth-legal-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    justify-content: center;
    margin-top: 20px;
    padding: 0 4px;
    font-size: 13px;
    text-align: center;
}

.auth-legal-links a {
    color: var(--mm-text-muted, #64748b);
    text-decoration: none;
}

.auth-legal-links a:hover {
    color: var(--mm-primary, #0f766e);
    text-decoration: underline;
}

/* Legal document pages */
.legal-page {
    font-family: var(--mm-font, 'Rubik', system-ui, sans-serif);
    margin: 0;
    min-height: 100vh;
    background: var(--mm-bg, #f1f5f9);
    color: var(--mm-text, #0f172a);
    display: flex;
    flex-direction: column;
}

.legal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 32px;
    background: #fff;
    border-bottom: 1px solid var(--mm-border, #e2e8f0);
}

.legal-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}

.legal-brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--mm-primary) 0%, var(--mm-primary-hover) 100%);
    display: grid;
    place-items: center;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.legal-brand-text {
    font-size: 16px;
    font-weight: 600;
}

.legal-brand-logo {
    max-height: 40px;
    max-width: 200px;
    object-fit: contain;
}

.legal-back {
    font-size: 14px;
    color: var(--mm-primary, #0f766e);
    text-decoration: none;
    font-weight: 500;
}

.legal-back:hover { text-decoration: underline; }

.legal-main {
    flex: 1;
    width: 100%;
    max-width: 820px;
    margin: 0 auto;
    padding: 32px 24px 48px;
    box-sizing: border-box;
}

.legal-card {
    background: #fff;
    border: 1px solid var(--mm-border, #e2e8f0);
    border-radius: var(--mm-radius-lg, 16px);
    padding: 36px 40px;
    box-shadow: var(--mm-shadow-sm);
}

.legal-card h1 {
    margin: 0 0 24px;
    font-size: 1.75rem;
    letter-spacing: -0.02em;
}

.legal-body {
    font-size: 15px;
    line-height: 1.7;
    color: var(--mm-text-secondary, #334155);
}

.legal-body p { margin: 0 0 16px; }
.legal-body h2, .legal-body h3 { margin: 28px 0 12px; color: var(--mm-text, #0f172a); }
.legal-body ul, .legal-body ol { margin: 0 0 16px; padding-left: 1.4rem; }
.legal-body li { margin-bottom: 8px; }
.legal-body a { color: var(--mm-primary, #0f766e); }

.legal-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 20px;
    justify-content: center;
    margin-top: 24px;
    font-size: 14px;
}

.legal-nav a {
    color: var(--mm-text-muted, #64748b);
    text-decoration: none;
}

.legal-nav a:hover {
    color: var(--mm-primary, #0f766e);
}

.legal-foot {
    text-align: center;
    padding: 20px;
    font-size: 13px;
    color: var(--mm-text-muted, #64748b);
    border-top: 1px solid var(--mm-border, #e2e8f0);
    background: #fff;
}

@media (max-width: 640px) {
    .legal-header { padding: 16px 20px; flex-wrap: wrap; }
    .legal-card { padding: 24px 20px; }
}

/* Legacy single-column wrap (fallback) */
.auth-wrap {
    min-height: 100vh;
    display: grid; place-items: center;
    background: var(--mm-bg, #f1f5f9);
    padding: 24px;
}

@media (max-width: 900px) {
    .auth-split { grid-template-columns: 1fr; }
    .auth-brand-panel { display: none; }
    .auth-main-panel { padding: 24px 16px; }
    .auth-card { padding: 28px 24px; }
}

@media (max-width: 640px) {
    .auth-form-grid { grid-template-columns: 1fr; }
}

.auth-phone-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
    margin-top: 6px;
}

.auth-phone-row input {
    flex: 1;
    min-width: 0;
}

.auth-sms-btn {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 10px 14px;
    font-size: 13px;
}

.auth-field-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--mm-text-muted, #64748b);
    line-height: 1.4;
}

.auth-sms-status {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    min-height: 1.25em;
    line-height: 1.4;
}

.auth-sms-status--ok {
    color: #065f46;
    font-weight: 500;
}

.auth-sms-status--error {
    color: #991b1b;
    font-weight: 500;
}

.auth-sms-status--pending {
    color: var(--mm-text-muted, #64748b);
}

@media (max-width: 640px) {
    .auth-phone-row {
        flex-direction: column;
    }

    .auth-sms-btn {
        width: 100%;
    }
}
