/* ═══════════════════════════════════════════════════════════════
   Admin Auth — Clean Professional Government Portal
   MSME Technology Centre — Ministry of MSME, Government of India
   v3.3.0
   ═══════════════════════════════════════════════════════════════ */

:root {
    --auth-primary:     #0f172a;
    --auth-primary-hov: #1e293b;
    --auth-accent:      #2563eb;
    --auth-saffron:     #ff9933;
    --auth-green:       #138808;
    --auth-red:         #dc2626;
    --auth-text:        #0f172a;
    --auth-text-muted:  #475569;
    --auth-text-subtle: #94a3b8;
    --auth-border:      #e2e8f0;
    --auth-bg:          #f1f5f9;
    --auth-surface:     #ffffff;
    --auth-radius:      12px;
    --auth-radius-sm:   8px;
    --auth-radius-xs:   6px;
}

/* ─── Enforce Clean Background ────────────────────────────────── */
/* Overrides welcome-redesign/premium-glass background leaks */
body.admin-auth-page {
    background-color: var(--auth-bg) !important;
    background-image: none !important;
    background-attachment: scroll !important;
    min-height: 100vh;
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    overflow-x: hidden;
    font-family: 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--auth-text);
    display: flex;
    flex-direction: column;
}

body.admin-auth-page .main-header,
body.admin-auth-page .admin-auth-banner,
body.admin-auth-page footer {
    width: 100%;
    flex-shrink: 0;
}

body.admin-auth-page footer {
    margin-top: 0 !important;
}

/* ─── Banner ──────────────────────────────────────────────────── */
.admin-auth-banner {
    background: #ffffff;
    border-bottom: 1px solid var(--auth-border);
    padding: 0.75rem 1rem;
    text-align: center;
    color: var(--auth-text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    position: relative;
    z-index: 10;
}
.admin-auth-banner i {
    color: var(--auth-primary);
}
    /* Removed tri-color stripe per user request */

.admin-auth-badge {
    display: inline-block;
    background: #f1f5f9;
    color: var(--auth-text-muted);
    border: 1px solid var(--auth-border);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.65rem;
    margin-left: 0.5rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    vertical-align: middle;
}

/* ─── Main Container ──────────────────────────────────────────── */
.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    width: 100%;
    box-sizing: border-box;
}

/* ─── Two-Column Grid ─────────────────────────────────────────── */
.auth-shell {
    width: 100%;
    max-width: 900px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
    background: var(--auth-surface);
    border-radius: var(--auth-radius);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    border: 1px solid var(--auth-border);
    overflow: hidden;
}

/* ─── Left Panel (Brand) ─────────────────────────────────────── */
.auth-shell-brand {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    background: var(--auth-primary) !important;
    color: #ffffff !important;
    position: relative;
    box-sizing: border-box;
}

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

.auth-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    padding: 0.3rem 0.75rem;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.5rem;
    color: #f8fafc;
}

.auth-hero h1 {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 0.75rem;
    color: #ffffff !important;
}

.auth-hero p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #cbd5e1 !important;
}

/* Feature list */
.auth-feature-list {
    list-style: none;
    margin: 2.5rem 0 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    position: relative;
    z-index: 1;
}

.auth-feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.9rem;
    font-weight: 400;
    color: #f1f5f9;
    line-height: 1.5;
}

.auth-feature-list li i {
    color: var(--auth-accent);
    font-size: 1rem;
    margin-top: 0.15rem;
}

.auth-brand-extra {
    margin-top: 2.5rem;
    position: relative;
    z-index: 1;
}

/* ─── Right Panel (Form) ──────────────────────────────────────── */
.auth-shell-panel {
    display: flex;
    flex-direction: column;
    padding: 3rem;
    background: var(--auth-surface);
    box-sizing: border-box;
}

.auth-form-card {
    width: 100%;
}

/* Form header */
.auth-form-header {
    margin-bottom: 2rem;
}

.auth-form-header h2 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--auth-text);
    letter-spacing: -0.01em;
}

.auth-form-header p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--auth-text-muted);
}

/* ─── Form Inputs ─────────────────────────────────────────────── */
.auth-field {
    margin-bottom: 1.25rem;
}

.auth-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--auth-text);
}

.auth-input {
    width: 100%;
    background: #ffffff !important;
    border: 1px solid var(--auth-border) !important;
    border-radius: var(--auth-radius-sm) !important;
    color: var(--auth-text) !important;
    padding: 0.75rem 1rem !important;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.auth-input::placeholder {
    color: var(--auth-text-subtle);
}

.auth-input:focus {
    outline: none;
    border-color: var(--auth-accent) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
}

.auth-input.error {
    border-color: var(--auth-red) !important;
}

.auth-error-text {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.75rem;
    color: var(--auth-red);
    font-weight: 500;
}

/* Password */
.auth-password-wrap {
    position: relative;
}

.auth-password-wrap .auth-input {
    padding-right: 2.5rem !important;
}

.auth-password-toggle {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: var(--auth-text-subtle);
    cursor: pointer;
    padding: 0.2rem;
    transition: color 0.2s;
}

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

/* ─── Options Row ─────────────────────────────────────────────── */
.auth-form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.auth-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--auth-text-muted);
    cursor: pointer;
    margin: 0;
}

.auth-checkbox-label input,
.auth-terms-row input {
    accent-color: var(--auth-accent);
    width: 16px;
    height: 16px;
    cursor: pointer;
    border: 1px solid var(--auth-border);
    border-radius: 4px;
}

.auth-link {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--auth-accent);
    text-decoration: none;
    transition: color 0.2s;
}

.auth-link:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Terms */
.auth-terms-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 1rem 0 1.5rem;
}

.auth-terms-row input {
    margin-top: 0.15rem;
    flex-shrink: 0;
}

.auth-terms-row label {
    font-size: 0.85rem;
    color: var(--auth-text-muted);
    margin: 0;
    cursor: pointer;
    line-height: 1.4;
}

/* ─── Submit Button ───────────────────────────────────────────── */
.auth-btn-primary {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: var(--auth-radius-sm);
    background: var(--auth-primary) !important;
    color: #ffffff !important;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
}

.auth-btn-primary:hover:not(:disabled) {
    background: var(--auth-primary-hov) !important;
}

.auth-btn-primary:active:not(:disabled) {
    transform: translateY(1px);
}

.auth-btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Back Link */
.auth-back-link {
    margin-top: 1.5rem;
    text-align: center;
}

.auth-back-link a {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--auth-text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

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

/* ─── Captcha ─────────────────────────────────────────────────── */
.auth-captcha-block {
    margin-bottom: 1.25rem;
}

.auth-captcha-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--auth-text);
    margin-bottom: 0.5rem;
}

.math-captcha-box {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.math-captcha-challenge {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8fafc;
    padding: 0.75rem 1rem;
    border-radius: var(--auth-radius-sm);
    border: 1px solid var(--auth-border);
}

.math-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--auth-text);
    font-family: monospace;
    letter-spacing: 1px;
}

.math-captcha-refresh {
    border: none;
    background: transparent;
    color: var(--auth-text-subtle);
    cursor: pointer;
    padding: 0.2rem;
    transition: color 0.2s;
}

.math-captcha-refresh:hover {
    color: var(--auth-text);
}

.math-captcha-input input {
    width: 100%;
    text-align: center;
    padding: 0.75rem 1rem !important;
    border-radius: var(--auth-radius-sm) !important;
    border: 1px solid var(--auth-border) !important;
    background: #ffffff !important;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s;
}

.math-captcha-input input:focus {
    outline: none;
    border-color: var(--auth-accent) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
}

.math-captcha-status {
    min-height: 1rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.math-captcha-status.error   { color: var(--auth-red); }
.math-captcha-status.success { color: var(--auth-green); }

/* ─── Steps (Forgot Password) ────────────────────────────────── */
.auth-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-step-item {
    display: flex;
    gap: 1rem;
}

.auth-step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
}

.auth-step-item strong {
    display: block;
    font-size: 0.85rem;
    color: #ffffff;
    margin-bottom: 0.2rem;
    font-weight: 500;
}

.auth-step-item span {
    font-size: 0.8rem;
    color: #94a3b8;
    line-height: 1.4;
}

/* ─── Password Requirements ──────────────────────────────────── */
.auth-requirements {
    margin-bottom: 1.25rem;
    padding: 1rem;
    border-radius: var(--auth-radius-sm);
    background: #f8fafc;
    border: 1px solid var(--auth-border);
}

.auth-requirements h6 {
    margin: 0 0 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--auth-text);
}

.auth-requirements ul {
    margin: 0;
    padding-left: 1.25rem;
    font-size: 0.8rem;
    color: var(--auth-text-muted);
}

.auth-requirements ul li { padding: 0.15rem 0; }

/* ─── Password Strength ──────────────────────────────────────── */
.auth-password-strength {
    margin-top: -0.75rem;
    margin-bottom: 1rem;
}

.goi-strength-bar {
    height: 4px;
    background: var(--auth-border);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 0.4rem;
}

.goi-strength-fill {
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
}

.goi-strength-weak   .goi-strength-fill { background: var(--auth-red); width: 25%; }
.goi-strength-fair   .goi-strength-fill { background: #f59e0b; width: 50%; }
.goi-strength-good   .goi-strength-fill { background: #10b981; width: 75%; }
.goi-strength-strong .goi-strength-fill { background: #059669; width: 100%; }

.goi-strength-text          { font-size: 0.75rem; font-weight: 500; }
.goi-strength-weak   .goi-strength-text { color: var(--auth-red); }
.goi-strength-fair   .goi-strength-text { color: #f59e0b; }
.goi-strength-good   .goi-strength-text { color: #10b981; }
.goi-strength-strong .goi-strength-text { color: #059669; }

/* ─── Two-Factor Authentication ───────────────────────────────── */
.auth-2fa-intro {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-2fa-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #eff6ff;
    color: var(--auth-accent);
    font-size: 1.35rem;
}

.auth-2fa-intro p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--auth-text-muted);
    line-height: 1.5;
}

.auth-label-center {
    text-align: center;
}

.auth-otp-input {
    letter-spacing: 0.35em;
    font-size: 1.25rem;
    font-weight: 600;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.auth-error-center {
    text-align: center;
    display: block;
}

.auth-2fa-alt {
    margin-top: 1.25rem;
    text-align: center;
}

.auth-2fa-alt .auth-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.auth-link-button {
    border: none;
    background: none;
    padding: 0;
    cursor: pointer;
    font: inherit;
}

.auth-masked-contact {
    color: var(--auth-text);
    font-weight: 600;
}

.auth-otp-boxes {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.auth-otp-box {
    width: 2.75rem;
    height: 3rem;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    border: 1px solid var(--auth-border);
    border-radius: var(--auth-radius-sm);
    background: #ffffff;
    color: var(--auth-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-otp-box:focus {
    outline: none;
    border-color: var(--auth-accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.auth-otp-box.error {
    border-color: var(--auth-red);
}

.auth-otp-resend {
    margin-top: 1.25rem;
    text-align: center;
}

.auth-otp-resend p {
    margin: 0 0 0.5rem;
    font-size: 0.85rem;
    color: var(--auth-text-muted);
}

.auth-otp-resend .auth-link-button {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.auth-security-tips {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: var(--auth-radius-sm);
    background: #f8fafc;
    border: 1px solid var(--auth-border);
}

.auth-security-tips h6 {
    margin: 0 0 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--auth-text);
}

.auth-security-tips ul {
    margin: 0;
    padding-left: 1.15rem;
    font-size: 0.8rem;
    color: var(--auth-text-muted);
    line-height: 1.5;
}

.auth-security-tips li {
    padding: 0.1rem 0;
}

@media (max-width: 400px) {
    .auth-otp-box {
        width: 2.35rem;
        height: 2.75rem;
        font-size: 1.1rem;
    }

    .auth-otp-boxes {
        gap: 0.35rem;
    }
}

/* ─── Footer Note ─────────────────────────────────────────────── */
.auth-form-footer-note {
    margin-top: 1.5rem;
    text-align: center;
}

.auth-form-footer-note p {
    margin: 0;
    font-size: 0.75rem;
    color: var(--auth-text-subtle);
}

/* ─── Notifications ───────────────────────────────────────────── */
.auth-form-card .goi-notification-container {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.auth-form-card .goi-alert {
    border-radius: var(--auth-radius-sm);
    padding: 0.85rem 1rem;
    margin: 0;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.85rem;
    line-height: 1.4;
    border: 1px solid transparent;
}

.auth-form-card .goi-alert i:first-child {
    margin-top: 0.15rem;
    font-size: 1rem;
    flex-shrink: 0;
}

.auth-form-card .auth-toast-body { flex: 1; min-width: 0; }

.auth-form-card .auth-toast-title {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.auth-form-card .auth-toast-message {
    display: block;
    font-size: 0.85rem;
}

.auth-form-card .goi-alert-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.auth-form-card .goi-alert-error .auth-toast-title { color: #7f1d1d; }

.auth-form-card .goi-alert-success {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
}

.auth-form-card .goi-alert-warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.auth-form-card .goi-alert-info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1e40af;
}

.auth-form-card .notification-close {
    border: none;
    background: transparent;
    color: inherit;
    opacity: 0.5;
    padding: 0.1rem;
    cursor: pointer;
    flex-shrink: 0;
}

.auth-form-card .notification-close:hover { opacity: 1; }

/* ─── Responsive ──────────────────────────────────────────────── */
@media (max-width: 800px) {
    .auth-shell {
        grid-template-columns: 1fr;
        max-width: 450px;
    }
    
    .auth-shell-brand {
        padding: 2rem;
        order: 2;
    }

    .auth-shell-panel {
        padding: 2rem;
        order: 1;
    }
}

@media (max-width: 480px) {
    .auth-main {
        padding: 1rem;
    }
    .auth-shell-brand, .auth-shell-panel {
        padding: 1.5rem;
    }
    .auth-shell {
        border-radius: var(--auth-radius-sm);
    }
}
