:root {
    --navy: #16140F;
    --teal: #96721D;
    --teal-hover: #7C5D17;
    --bg: #F8F9FB;
    --surface: #FFFFFF;
    --border: #E5E7EB;
    --text: #1F2937;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --danger: #B91C1C;
    --danger-bg: #FEF2F2;
    --success: #15803D;
    --success-bg: #F0FDF4;
    --warning: #B45309;
    --info: #2563EB;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', 'Noto Sans Devanagari', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.auth-page {
    min-height: 100vh;
    display: flex;
}

/* Left branding panel — hidden on mobile, shown on desktop */
.auth-brand {
    display: none;
    position: relative;
    overflow: hidden;
    flex: 1 1 42%;
    background: var(--navy);
    color: #fff;
    padding: 48px;
    flex-direction: column;
    justify-content: space-between;
}

.brand-watermark {
    position: absolute;
    bottom: -70px;
    right: -70px;
    width: 340px;
    height: 340px;
    color: var(--teal);
    opacity: 0.14;
    pointer-events: none;
}

.auth-brand-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-brand-top .logo-mark {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: var(--radius-md);
    object-fit: cover;
    display: block;
}

.auth-brand-top .brand-name {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.2px;
}

.auth-brand-mid {
    max-width: 380px;
}

.auth-brand-mid h1 {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 12px;
}

.auth-brand-mid p {
    color: rgba(255,255,255,0.72);
    font-size: 15px;
    margin: 0;
}

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

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

.auth-brand-features li::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--teal);
    flex-shrink: 0;
}

.auth-brand-bottom {
    font-size: 13px;
    color: rgba(255,255,255,0.45);
}

/* Right form panel */
.auth-form-panel {
    flex: 1 1 58%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-form-wrap {
    width: 100%;
    max-width: 400px;
}

.auth-form-header-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 28px;
}

.auth-form-header-mobile .logo-mark {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: var(--radius-md);
    object-fit: cover;
    display: block;
}

.auth-form-header-mobile .brand-name {
    font-weight: 700;
    font-size: 17px;
    color: var(--navy);
}

.auth-card {
    position: relative;
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
}

.card-watermark {
    position: absolute;
    top: -28px;
    right: -28px;
    width: 150px;
    height: 150px;
    color: var(--teal);
    opacity: 0.08;
    pointer-events: none;
}

.auth-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--navy);
    margin: 0 0 6px;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0 0 24px;
}

.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
}

.form-label .required {
    color: var(--danger);
}

.form-input {
    width: 100%;
    padding: 11px 14px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: border-color 150ms ease, box-shadow 150ms ease;
    min-height: 44px;
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

.form-input.has-error {
    border-color: var(--danger);
}

.field-error {
    font-size: 12.5px;
    color: var(--danger);
    margin-top: 6px;
}

.form-hint {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 6px;
}

.password-strength {
    display: none;
    margin-top: 8px;
}

.password-strength.is-visible {
    display: block;
}

.strength-bar {
    display: flex;
    gap: 4px;
    margin-bottom: 5px;
}

.strength-bar span {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: var(--border);
    transition: background-color 150ms ease;
}

.strength-bar span.on-weak { background: var(--danger); }
.strength-bar span.on-fair { background: var(--warning); }
.strength-bar span.on-good { background: var(--info); }
.strength-bar span.on-strong { background: var(--success); }

.strength-label {
    font-size: 12.5px;
    font-weight: 500;
}

.strength-label.weak { color: var(--danger); }
.strength-label.fair { color: var(--warning); }
.strength-label.good { color: var(--info); }
.strength-label.strong { color: var(--success); }

.password-field {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover { color: var(--text-secondary); }

.password-toggle .icon-eye-off { display: none; }

.password-toggle.is-showing .icon-eye { display: none; }
.password-toggle.is-showing .icon-eye-off { display: block; }

.form-row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    font-size: 13.5px;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.checkbox-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--teal);
}

.checkbox-row label {
    color: var(--text-secondary);
    font-size: 13.5px;
}

.link-teal {
    color: var(--teal);
    text-decoration: none;
    font-weight: 500;
}

.link-teal:hover { text-decoration: underline; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 20px;
    font-size: 14.5px;
    font-family: inherit;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color 150ms ease, border-color 150ms ease, opacity 150ms ease;
    min-height: 44px;
}

.btn-primary {
    background: var(--teal);
    color: #fff;
}

.btn-primary:hover { background: var(--teal-hover); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}

.btn-secondary:hover { background: var(--bg); }

.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0;
    color: var(--text-muted);
    font-size: 12.5px;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.btn-google {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 11px 20px;
    font-size: 14px;
    font-family: inherit;
    font-weight: 500;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: not-allowed;
    opacity: 0.55;
    min-height: 44px;
}

.btn-google .badge-soon {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 2px 8px;
    border-radius: 999px;
    margin-left: 4px;
}

.auth-footer-text {
    text-align: center;
    font-size: 13.5px;
    color: var(--text-secondary);
    margin-top: 22px;
}

.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.alert-error {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: #FECACA;
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border-color: #BBF7D0;
}

.alert-info {
    background: #EFF6FF;
    color: #2563EB;
    border-color: #BFDBFE;
}

.dev-note {
    margin-top: 14px;
    padding: 10px 12px;
    background: var(--bg);
    border: 1px dashed var(--border);
    border-radius: var(--radius-md);
    font-size: 12.5px;
    color: var(--text-secondary);
    word-break: break-all;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 18px;
}

.back-link:hover { color: var(--text); }

/* Icon-prefixed inputs */
.input-icon-wrap {
    position: relative;
}

.input-icon-wrap .form-input {
    padding-left: 42px;
}

.input-icon-wrap .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    display: flex;
    pointer-events: none;
}

.password-field .form-input {
    padding-right: 54px;
}

@media (min-width: 1024px) {
    .auth-brand { display: flex; }
    .auth-form-header-mobile { display: none; }
}

@media (max-width: 1023px) {
    /* min-height:100vh on mobile browsers reserves space behind the
       address bar, leaving a blank gap at the bottom. 100dvh tracks the
       actual visible viewport instead. */
    .auth-page {
        min-height: 100vh;
        min-height: 100dvh;
    }
}

/*
 * iOS Safari (and some Android browsers) auto-zoom the page on focus for
 * any text input whose computed font-size is under 16px — the fields on
 * these auth pages sit lower for visual density. Overriding back up to
 * 16px on mobile only stops the zoom without disabling the user's own
 * pinch-zoom elsewhere. See the matching rule in app.css for the rest of
 * the app.
 */
@media (max-width: 1023px) {
    input, select, textarea {
        font-size: 16px !important;
    }
}
