/* Dhimson Learn — Auth pages (student & admin login) */
/* Font loaded via layouts/auth.blade.php (avoid @import issues on live hosting) */

:root {
    --auth-font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --auth-primary: #667eea;
    --auth-primary-dark: #5a67d8;
    --auth-primary-light: #818cf8;
    --auth-accent: #764ba2;
    --auth-text: #1e293b;
    --auth-text-muted: #64748b;
    --auth-border: #e2e8f0;
    --auth-error: #ef4444;
    --auth-success: #22c55e;
    --auth-radius: 16px;
    --auth-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.15);
}

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

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: var(--auth-font);
    -webkit-font-smoothing: antialiased;
}

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

/* ── Brand panel (left) ── */
.auth-brand {
    flex: 1;
    display: none;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px;
    color: #fff;
    position: relative;
    overflow: hidden;
}

@media (min-width: 992px) {
    .auth-brand { display: flex; }
}

.auth-brand--student {
    background: linear-gradient(145deg, #667eea 0%, #764ba2 50%, #5b21b6 100%);
}

.auth-brand--admin {
    background: linear-gradient(145deg, #1e293b 0%, #0f172a 60%, #1e1b4b 100%);
}

.auth-brand__bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.auth-brand__orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.35;
}

.auth-brand__orb--1 {
    width: 320px;
    height: 320px;
    background: #fff;
    top: -80px;
    right: -80px;
}

.auth-brand__orb--2 {
    width: 240px;
    height: 240px;
    background: #c4b5fd;
    bottom: 10%;
    left: -60px;
}

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

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

.auth-brand__logo img {
    max-height: 52px;
    max-width: min(280px, 100%);
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: left center;
}

.auth-brand__logo:has(img) .auth-brand__logo-text {
    display: none;
}

.auth-brand__logo-icon {
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.15);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
}

.auth-brand__logo-text {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

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

.auth-brand__sub {
    font-size: 1.05rem;
    line-height: 1.6;
    opacity: 0.88;
    max-width: 380px;
    margin: 0 0 0;
}

.auth-brand__features {
    list-style: none;
    padding: 0;
    margin: 1.35rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.auth-brand__features li {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 0.95rem;
    font-weight: 500;
}

.auth-brand__feature-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255,255,255,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.auth-brand__footer {
    position: relative;
    z-index: 1;
    font-size: 0.85rem;
    opacity: 0.7;
}

/* ── Form panel (right) ── */
.auth-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #f8fafc;
    position: relative;
}

.auth-topbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 16px 20px 12px;
    background: #fff;
    border-bottom: 1px solid var(--auth-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.auth-topbar__home {
    display: flex;
    align-items: center;
}

.auth-portal-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
}

@media (min-width: 640px) {
    .auth-portal-nav {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 992px) {
    .auth-topbar {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        background: #ffffff;
        border-bottom: 1px solid var(--auth-border);
        padding: 16px 24px;
    }

    .auth-portal-nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 8px;
        width: auto;
        max-width: min(100%, 760px);
    }
}

.auth-portal-nav__link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 52px;
    padding: 8px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--auth-text-muted);
    text-decoration: none;
    background: #f8fafc;
    border: 1px solid var(--auth-border);
    transition: all 0.2s ease;
    text-align: center;
    line-height: 1.2;
}

@media (min-width: 992px) {
    .auth-portal-nav__link {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 6px;
        min-height: auto;
        padding: 7px 12px;
        border-radius: 999px;
        white-space: nowrap;
    }
}

.auth-portal-nav__role {
    font-weight: 700;
    color: var(--auth-text);
    font-size: 0.82rem;
}

.auth-portal-nav__action {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--auth-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

@media (min-width: 992px) {
    .auth-portal-nav__role,
    .auth-portal-nav__action {
        font-size: 0.78rem;
        text-transform: none;
        letter-spacing: normal;
        color: inherit;
        font-weight: 600;
    }

    .auth-portal-nav__action::before {
        content: '·';
        margin-right: 6px;
        color: #cbd5e1;
        font-weight: 400;
    }
}

.auth-portal-nav__link:hover {
    color: var(--auth-primary);
    border-color: var(--auth-primary-light);
    background: #eef2ff;
}

.auth-portal-nav__link.is-active {
    color: var(--auth-primary);
    border-color: #c7d2fe;
    background: #eef2ff;
    pointer-events: none;
}

.auth-page--admin .auth-portal-nav__link.is-active {
    color: #475569;
    border-color: #cbd5e1;
    background: #f1f5f9;
}

.auth-portal-nav-strip {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.auth-portal-nav-strip .auth-portal-nav {
    justify-content: flex-end;
    padding: 10px 0;
}

.auth-topbar__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--auth-text-muted);
    text-decoration: none;
    background: #fff;
    border: 1px solid var(--auth-border);
    transition: all 0.2s ease;
}

.auth-topbar__link:hover {
    color: var(--auth-primary);
    border-color: var(--auth-primary-light);
    background: #eef2ff;
}

.auth-topbar__link--accent {
    color: var(--auth-primary);
    border-color: #c7d2fe;
    background: #eef2ff;
}

.auth-page--admin .auth-topbar__link--accent {
    color: #475569;
    border-color: #cbd5e1;
    background: #f1f5f9;
}

.auth-form-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

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

@media (max-width: 480px) {
    .auth-card { padding: 32px 24px; }
}

.auth-mobile-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
}

@media (min-width: 992px) {
    .auth-mobile-logo { display: none; }
}

.auth-mobile-logo img {
    max-height: 40px;
    max-width: min(240px, 100%);
    width: auto;
    height: auto;
    object-fit: contain;
}

.auth-mobile-logo:has(img) span {
    display: none;
}

.auth-mobile-logo span {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--auth-text);
}

.auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.auth-badge--student {
    background: #eef2ff;
    color: var(--auth-primary);
}

.auth-badge--admin {
    background: #fef3c7;
    color: #b45309;
}

.auth-card__title {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--auth-text);
    letter-spacing: -0.03em;
    margin: 0 0 8px;
}

.auth-card__subtitle {
    font-size: 0.95rem;
    color: var(--auth-text-muted);
    margin: 0 0 28px;
    line-height: 1.5;
}

.auth-alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 0.875rem;
    margin-bottom: 20px;
    line-height: 1.45;
}

.auth-alert--error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
}

.auth-alert--info {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.auth-field {
    margin-bottom: 20px;
}

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

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

.auth-input-wrap svg.auth-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.auth-input {
    width: 100%;
    padding: 13px 14px 13px 44px;
    border: 1.5px solid var(--auth-border);
    border-radius: 12px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--auth-text);
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-input:focus {
    outline: none;
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.12);
}

.auth-input.is-error {
    border-color: var(--auth-error);
}

/* Phone +91 prefix */
.phone-input-wrap .phone-input-prefix {
    position: absolute;
    left: 44px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--auth-text);
    pointer-events: none;
    z-index: 1;
    line-height: 1;
}

.phone-input-wrap .phone-input-field {
    padding-left: 5.75rem;
}

.phone-input-wrap--contact {
    position: relative;
    display: flex;
    align-items: stretch;
}

.phone-input-wrap--contact .phone-input-prefix {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 600;
    color: #334155;
    font-size: 1rem;
    pointer-events: none;
    z-index: 1;
}

.phone-input-wrap--contact input {
    width: 100%;
    padding: var(--space-3) var(--space-3) var(--space-3) 3.75rem;
    border: 1px solid var(--neutral-300);
    border-radius: var(--radius-lg);
    font-size: var(--text-base);
    font-family: inherit;
    background: var(--neutral-0);
}

.phone-input-wrap--contact input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px var(--primary-100);
}

.phone-input-wrap--bootstrap .phone-input-prefix {
    position: static;
    transform: none;
    font-weight: 600;
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
    flex-shrink: 0;
}

.phone-input-wrap--bootstrap {
    flex-wrap: nowrap;
}

.phone-input-wrap--bootstrap .phone-input-field {
    min-width: 0;
}

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

.auth-toggle-pw {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #94a3b8;
    display: flex;
    align-items: center;
}

.auth-toggle-pw:hover { color: var(--auth-primary); }

.auth-field-error {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 6px;
    font-size: 0.8rem;
    color: var(--auth-error);
}

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 12px;
    flex-wrap: wrap;
}

.auth-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.auth-check input {
    width: 16px;
    height: 16px;
    accent-color: var(--auth-primary);
    cursor: pointer;
}

.auth-check span {
    font-size: 0.875rem;
    color: var(--auth-text-muted);
}

.auth-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--auth-primary);
    text-decoration: none;
}

.auth-link:hover { color: var(--auth-primary-dark); }

.auth-page--admin .auth-link { color: #475569; }
.auth-page--admin .auth-link:hover { color: #1e293b; }

.auth-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.auth-btn--student {
    background: linear-gradient(135deg, var(--auth-primary) 0%, var(--auth-accent) 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.35);
}

.auth-btn--admin {
    background: linear-gradient(135deg, #334155 0%, #1e293b 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(30, 41, 59, 0.3);
}

.auth-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.auth-btn--admin:hover {
    box-shadow: 0 8px 20px rgba(30, 41, 59, 0.4);
}

.auth-btn:active { transform: translateY(0); }

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

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

.auth-footer-text {
    text-align: center;
    font-size: 0.9rem;
    color: var(--auth-text-muted);
    line-height: 1.5;
    margin: 0;
}

.auth-footer-text a {
    color: var(--auth-primary);
    font-weight: 700;
    text-decoration: none;
}

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

.auth-footer-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 4px;
    padding: 13px 16px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none !important;
    color: var(--auth-primary) !important;
    background: #eef2ff;
    border: 1.5px solid #c7d2fe;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.auth-footer-cta:hover {
    background: #e0e7ff;
    border-color: var(--auth-primary-light);
    transform: translateY(-1px);
    text-decoration: none !important;
}

.auth-page--admin .auth-footer-cta {
    color: #334155 !important;
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.auth-page--admin .auth-footer-cta:hover {
    background: #e2e8f0;
}

/* Register page */
.auth-card--wide {
    max-width: 480px;
}

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

.auth-page--student .auth-card--register-wide {
    max-width: 680px;
}

.auth-card--application {
    max-width: 720px;
    padding: 32px 28px;
}

.auth-form-wrap--scroll {
    align-items: flex-start;
    padding-top: 32px;
    padding-bottom: 32px;
}

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

@media (max-width: 540px) {
    .auth-grid { grid-template-columns: 1fr; gap: 0; }
}

.auth-input--plain {
    padding-left: 14px;
}

.auth-required {
    color: var(--auth-error);
}

.auth-hint {
    font-size: 0.78rem;
    color: var(--auth-text-muted);
    margin-top: 6px;
}

.auth-terms {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid var(--auth-border);
    border-radius: 12px;
    margin-bottom: 20px;
}

.auth-terms input {
    width: 16px;
    height: 16px;
    margin-top: 3px;
    accent-color: var(--auth-primary);
    flex-shrink: 0;
    cursor: pointer;
}

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

.auth-terms a {
    color: var(--auth-primary);
    font-weight: 600;
    text-decoration: none;
}

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

.data-consent-error {
    margin-top: -12px;
    margin-bottom: 16px;
}

.data-consent-checkbox--contact {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 8px 0 20px;
    text-align: left;
}

.data-consent-checkbox--contact input[type="checkbox"] {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 3px;
    accent-color: var(--primary-600, #667eea);
}

.data-consent-checkbox--contact label {
    font-size: 0.9rem;
    line-height: 1.55;
    color: #475569;
    font-weight: 500;
}

.data-consent-checkbox--contact label a {
    color: #1d4ed8;
    text-decoration: underline;
}
