/* =========================================================
   EduFlow ERP — Authentication Pages
   Matches landing page design tokens
   ========================================================= */

:root {
    --erp-ink: #0b1f2a;
    --erp-ink-soft: #1e3a4c;
    --erp-muted: #5b7180;
    --erp-primary: #0f766e;
    --erp-primary-dark: #0d5f59;
    --erp-primary-light: #14b8a6;
    --erp-accent: #0e7490;
    --erp-surface: #f3faf8;
    --erp-surface-alt: #e8f5f2;
    --erp-white: #ffffff;
    --erp-border: rgba(15, 118, 110, 0.12);
    --erp-shadow: 0 10px 30px rgba(11, 31, 42, 0.08);
    --erp-shadow-lg: 0 24px 48px rgba(11, 31, 42, 0.12);
    --erp-radius: 1rem;
    --erp-radius-lg: 1.5rem;
    --erp-font: "Plus Jakarta Sans", system-ui, sans-serif;
    --erp-display: "Outfit", "Plus Jakarta Sans", system-ui, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body.auth-page {
    font-family: var(--erp-font);
    color: var(--erp-ink);
    background: var(--erp-surface);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.auth-page h1,
.auth-page h2,
.auth-page h3,
.auth-page .display-font {
    font-family: var(--erp-display);
    letter-spacing: -0.02em;
}

.auth-page a {
    text-decoration: none;
}

.auth-page a:focus-visible,
.auth-page button:focus-visible,
.auth-page .btn:focus-visible,
.auth-page .form-control:focus-visible,
.auth-page .form-check-input:focus-visible {
    outline: 2px solid var(--erp-primary);
    outline-offset: 2px;
}

/* ---------- Layout ---------- */

.auth-shell {
    min-height: 100vh;
}

.auth-branding {
    position: relative;
    background:
        radial-gradient(ellipse 80% 60% at 20% 10%, rgba(20, 184, 166, 0.22), transparent 55%),
        radial-gradient(ellipse 50% 40% at 90% 80%, rgba(14, 116, 144, 0.18), transparent 50%),
        linear-gradient(160deg, #0b1f2a 0%, #143447 55%, #0d5f59 100%);
    color: #fff;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.auth-branding::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: linear-gradient(180deg, #000 20%, transparent 95%);
    pointer-events: none;
}

.auth-branding-inner {
    position: relative;
    z-index: 1;
    max-width: 440px;
    margin: 0 auto;
    width: 100%;
}

.auth-brand-link {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: #fff !important;
    font-family: var(--erp-display);
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 0.7rem;
    background: linear-gradient(145deg, var(--erp-primary-light), var(--erp-primary-dark));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.auth-branding .tagline {
    font-size: clamp(1.75rem, 3vw, 2.35rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.auth-branding .desc {
    color: rgba(255, 255, 255, 0.78);
    font-size: 1.02rem;
    line-height: 1.7;
    margin-bottom: 1.75rem;
}

.auth-benefits {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem;
}

.auth-benefits li {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.45rem 0;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    font-size: 0.95rem;
}

.auth-benefits i {
    color: var(--erp-primary-light);
    font-size: 1.1rem;
}

.auth-preview {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--erp-radius);
    padding: 1rem;
    backdrop-filter: blur(8px);
}

.auth-preview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.auth-preview-chip {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    padding: 0.85rem;
    text-align: center;
}

.auth-preview-chip i {
    display: block;
    font-size: 1.35rem;
    color: var(--erp-primary-light);
    margin-bottom: 0.35rem;
}

.auth-preview-chip span {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

/* ---------- Form panel ---------- */

.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
    background:
        radial-gradient(ellipse 70% 50% at 100% 0%, rgba(20, 184, 166, 0.08), transparent 50%),
        var(--erp-surface);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border: 1px solid var(--erp-border);
    border-radius: var(--erp-radius-lg);
    box-shadow: var(--erp-shadow-lg);
    padding: 2rem 1.75rem;
}

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

.auth-card-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-family: var(--erp-display);
    font-weight: 700;
    color: var(--erp-ink);
    margin-bottom: 1.5rem;
}

.auth-card h1 {
    font-size: clamp(1.5rem, 3vw, 1.85rem);
    font-weight: 800;
    color: var(--erp-ink);
    margin-bottom: 0.4rem;
}

.auth-card .subtitle {
    color: var(--erp-muted);
    font-size: 0.98rem;
    margin-bottom: 1.75rem;
    line-height: 1.55;
}

.auth-mobile-brand {
    display: none;
}

/* ---------- Form controls ---------- */

.auth-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--erp-ink-soft);
    margin-bottom: 0.4rem;
}

.auth-input-group {
    position: relative;
}

.auth-input-group .form-control {
    height: 52px;
    border-radius: 0.75rem;
    border: 1px solid rgba(15, 118, 110, 0.18);
    padding-left: 2.85rem;
    padding-right: 1rem;
    font-size: 0.95rem;
    color: var(--erp-ink);
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-input-group.has-toggle .form-control {
    padding-right: 3rem;
}

.auth-input-group .form-control::placeholder {
    color: #94a3b8;
}

.auth-input-group .form-control:focus {
    border-color: var(--erp-primary);
    box-shadow: 0 0 0 0.2rem rgba(15, 118, 110, 0.15);
}

.auth-input-group .form-control.is-invalid {
    border-color: #dc3545;
    padding-right: 3rem;
    background-image: none;
}

.auth-input-group .input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--erp-muted);
    font-size: 1.05rem;
    pointer-events: none;
    z-index: 2;
}

.password-toggle {
    position: absolute;
    right: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 42px;
    height: 42px;
    border: 0;
    background: transparent;
    color: var(--erp-muted);
    border-radius: 0.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.password-toggle:hover {
    color: var(--erp-primary);
    background: rgba(15, 118, 110, 0.08);
}

.invalid-feedback {
    font-size: 0.85rem;
}

.auth-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.35rem;
}

.auth-meta .form-check-input {
    width: 1.1rem;
    height: 1.1rem;
    border-color: rgba(15, 118, 110, 0.35);
    margin-top: 0.15rem;
}

.auth-meta .form-check-input:checked {
    background-color: var(--erp-primary);
    border-color: var(--erp-primary);
}

.auth-meta .form-check-label {
    font-size: 0.9rem;
    color: var(--erp-ink-soft);
}

.auth-link {
    color: var(--erp-primary) !important;
    font-weight: 600;
    font-size: 0.9rem;
}

.auth-link:hover {
    color: var(--erp-primary-dark) !important;
    text-decoration: underline;
}

.btn-erp {
    --bs-btn-bg: var(--erp-primary);
    --bs-btn-border-color: var(--erp-primary);
    --bs-btn-hover-bg: var(--erp-primary-dark);
    --bs-btn-hover-border-color: var(--erp-primary-dark);
    --bs-btn-active-bg: var(--erp-primary-dark);
    --bs-btn-active-border-color: var(--erp-primary-dark);
    --bs-btn-color: #fff;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-color: #fff;
    font-weight: 600;
    border-radius: 0.75rem;
    min-height: 52px;
    padding: 0.75rem 1.4rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.btn-erp:hover,
.btn-erp:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(15, 118, 110, 0.28);
}

.btn-erp:disabled,
.btn-erp.is-loading {
    opacity: 0.85;
    transform: none;
    cursor: wait;
}

.btn-erp .spinner-border {
    width: 1.1rem;
    height: 1.1rem;
    border-width: 0.15em;
}

.auth-footer-text {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--erp-muted);
    font-size: 0.95rem;
}

.auth-alert {
    border: 0;
    border-radius: 0.85rem;
    padding: 0.9rem 1rem;
    font-size: 0.92rem;
    margin-bottom: 1.25rem;
}

.auth-alert-danger {
    background: rgba(220, 53, 69, 0.08);
    color: #b02a37;
}

.auth-alert-success {
    background: rgba(15, 118, 110, 0.1);
    color: var(--erp-primary-dark);
}

.password-hints {
    background: var(--erp-surface);
    border: 1px solid var(--erp-border);
    border-radius: 0.75rem;
    padding: 0.85rem 1rem;
    margin-top: 0.65rem;
    margin-bottom: 0.25rem;
}

.password-hints p {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--erp-ink-soft);
    margin-bottom: 0.35rem;
}

.password-hints ul {
    margin: 0;
    padding-left: 1.1rem;
    color: var(--erp-muted);
    font-size: 0.8rem;
}

.password-strength {
    height: 4px;
    border-radius: 999px;
    background: #e2e8f0;
    margin-top: 0.55rem;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    width: 0;
    border-radius: 999px;
    transition: width 0.25s ease, background-color 0.25s ease;
}

.password-strength-bar.weak { width: 33%; background: #ef4444; }
.password-strength-bar.fair { width: 66%; background: #f59e0b; }
.password-strength-bar.strong { width: 100%; background: var(--erp-primary); }

.password-strength-label {
    font-size: 0.75rem;
    color: var(--erp-muted);
    margin-top: 0.3rem;
    min-height: 1.1em;
}

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--erp-muted);
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
}

.auth-back:hover {
    color: var(--erp-primary);
}

.btn-auth-secondary {
    border-radius: 0.75rem;
    min-height: 48px;
    font-weight: 600;
    color: var(--erp-ink-soft);
    border-color: rgba(15, 118, 110, 0.2);
}

.btn-auth-secondary:hover {
    background: var(--erp-surface);
    border-color: var(--erp-primary);
    color: var(--erp-primary-dark);
}

/* ---------- Responsive ---------- */

@media (max-width: 991.98px) {
    .auth-branding {
        display: none;
    }

    .auth-mobile-brand {
        display: inline-flex;
    }

    .auth-panel {
        min-height: 100vh;
        padding: 1.5rem 1rem 2rem;
    }

    .auth-card {
        padding: 1.75rem 1.35rem;
        box-shadow: var(--erp-shadow);
    }
}

@media (max-width: 575.98px) {
    .auth-card {
        border-radius: var(--erp-radius);
        padding: 1.5rem 1.15rem;
    }

    .auth-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .auth-input-group .form-control {
        font-size: 16px; /* prevent iOS zoom */
    }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    .auth-branding {
        padding: 2rem 1.5rem;
    }

    .auth-card {
        max-width: 420px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .btn-erp:hover,
    .btn-erp:focus-visible {
        transform: none;
    }

    .password-strength-bar {
        transition: none;
    }
}
