:root {
    --bg: #f6f7fb;
    --white: #ffffff;
    --text: #1f2937;
    --muted: #7c8499;
    --line: #d9dde7;
    --primary: #111827;
    --primary-2: #1e3a8a;
    --accent: #2563eb;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
}

body {
    min-height: 100vh;
}

a {
    text-decoration: none;
}

.auth-shell {
    width: 100%;
    height: 100vh;
    display: grid;
    grid-template-columns: 1.02fr 1fr;
    background: var(--white);
}

.auth-left {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 30px 34px;
}

.slide-show {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.slide-track {
    position: absolute;
    inset: 0;
}

.slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: scale(1.05);
    transition: opacity 1s ease, transform 5s ease;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.slide::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(11, 31, 58, 0.85), rgba(11, 31, 58, 0.9));
    z-index: 1;
}

.slide.active {
    opacity: 1;
    transform: scale(1);
}

.slide-overlay {
    display: none;
}

.brand,
.slide-content {
    position: relative;
    z-index: 2;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    font-size: 1.5rem;
    font-weight: 700;
}

.brand-logo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: #111827;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 900;
}

.slide-content {
    max-width: 500px;
    color: #fff;
}

.slide-content h1 {
    font-size: 2.7rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 12px;
}

.slide-content p {
    font-size: 1.05rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.92);
    max-width: 460px;
}

.slide-dots {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 24px;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.45);
    transition: all 0.35s ease;
}

.dot.active {
    width: 38px;
    background: #fff;
    box-shadow: 0 0 18px rgba(255, 255, 255, 0.45);
}

.auth-right {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 30px;
    background: #fcfcfd;
    overflow: hidden;
}

.auth-card {
    width: 100%;
}

.login-card {
    max-width: 450px;
}

.register-card {
    max-width: 620px;
}

.auth-card h2 {
    font-size: 2.45rem;
    line-height: 1.08;
    font-weight: 800;
    color: var(--primary-2);
    margin-bottom: 8px;
}

.auth-desc {
    color: var(--muted);
    font-size: 0.95rem;
    margin-bottom: 18px;
}

.auth-form {
    width: 100%;
}

.field {
    margin-bottom: 14px;
}

.field label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 7px;
}

.field input,
.field select {
    width: 100%;
    height: 50px;
    border: 1.4px solid #cfd5e3;
    border-radius: 12px;
    padding: 0 15px;
    font-size: 0.95rem;
    background: #fff;
    color: var(--text);
    outline: none;
    transition: 0.2s ease;
}

.field input:focus,
.field select:focus {
    border-color: #64748b;
    box-shadow: 0 0 0 4px rgba(30, 58, 138, 0.08);
}

.form-row {
    margin: 4px 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.remember-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    color: #374151;
}

.text-link {
    font-size: 0.9rem;
    color: #7c8499;
}

.main-btn {
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(90deg, #191d24, #111827);
    color: #fff;
    font-size: 0.96rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
}

.main-btn:hover {
    opacity: 0.95;
}

.bottom-text {
    margin-top: 18px;
    text-align: center;
    color: #8a91a5;
    font-size: 0.94rem;
}

.bottom-text a {
    color: var(--accent);
    font-weight: 700;
}

.compact-register {
    max-width: 610px;
}

.compact-register h2 {
    font-size: 2rem;
    margin-bottom: 6px;
}

.compact-register .auth-desc {
    margin-bottom: 14px;
    font-size: 0.9rem;
}
/* ── Register grid ──────────────────────────────────────── */
/* Uses a 6-column base so we can do:
   [First(3)] [MI(1)] [Last(3)] → row 1
   [StudentID(3)] [Mobile(3)]   → row 2
   [Course(6)]                  → row 3
   [Email(6)]                   → row 4
   [Password(6)]                → row 5
   [YearLevel(3)] [Section(3)]  → row 6
*/
.compact-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px 14px;
}

.compact-grid .field {
    margin-bottom: 0;
    grid-column: span 3; /* default: half row */
}

/* Name row */
.compact-grid .col-first   { grid-column: span 2; }
.compact-grid .col-mi      { grid-column: span 2; }  /* narrow MI */
.compact-grid .col-last    { grid-column: span 2; }

/* Renames col-span-1 to also just mean "3 of 6 columns" */
.compact-grid .col-span-1  { grid-column: span 3; }

/* Full width */
.compact-grid .full        { grid-column: 1 / -1; }

.compact-grid .field label {
    display: block;
    font-size: 0.84rem;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 5px;
}

.compact-grid .field input,
.compact-grid .field select {
    width: 100%;
    height: 44px;
    font-size: 0.9rem;
    border-radius: 10px;
    border: 1.4px solid #cfd5e3;
    padding: 0 13px;
    background: #fff;
    color: #1f2937;
    outline: none;
    transition: 0.2s ease;
}

.compact-grid .field input:focus,
.compact-grid .field select:focus {
    border-color: #64748b;
    box-shadow: 0 0 0 4px rgba(30, 58, 138, 0.08);
}


.compact-btn {
    margin-top: 12px;
    height: 46px;
    font-size: 0.93rem;
}

.compact-bottom {
    margin-top: 12px;
    font-size: 0.9rem;
}

@media (max-width: 1200px) {
    .auth-shell {
        grid-template-columns: 0.95fr 1fr;
    }

    .slide-content h1 {
        font-size: 2.3rem;
    }

    .auth-card h2 {
        font-size: 2.1rem;
    }

    .compact-register h2 {
        font-size: 1.8rem;
    }

    .register-card,
    .compact-register {
        max-width: 560px;
    }
}

@media (max-width: 980px) {
    html,
    body {
        overflow: auto;
    }

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

    .auth-left {
        min-height: 300px;
    }

    .auth-right {
        height: auto;
        min-height: auto;
        padding: 28px 20px 32px;
        overflow: visible;
    }

    .compact-grid {
        grid-template-columns: 1fr;
    }

    .compact-grid .field,
    .compact-grid .full,
    .compact-grid .col-first,
    .compact-grid .col-mi,
    .compact-grid .col-last,
    .compact-grid .col-span-1 {
        grid-column: 1 / -1;
    }
}

@media (max-width: 640px) {
    .auth-left {
        padding: 22px 20px;
    }

    .brand {
        font-size: 1.3rem;
    }

    .brand-logo {
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
    }

    .slide-content h1 {
        font-size: 1.9rem;
    }

    .slide-content p {
        font-size: 0.96rem;
    }

    .auth-right {
        padding: 24px 16px 28px;
    }

    .auth-card h2,
    .compact-register h2 {
        font-size: 1.7rem;
    }

    .form-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

.password-field {
    position: relative;
    width: 100%;
}

.password-field input {
    width: 100%;
    height: 50px;
    padding: 0 78px 0 15px;
    border: 1.4px solid #cfd5e3;
    border-radius: 12px;
    font-size: 0.95rem;
    background: #fff;
    color: #1f2937;
    outline: none;
    transition: 0.2s ease;
}

.password-field input:focus {
    border-color: #64748b;
    box-shadow: 0 0 0 4px rgba(30, 58, 138, 0.08);
}

.toggle-password {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    height: calc(100% - 12px);
    min-width: 58px;
    padding: 0 12px;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: #2563eb;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.toggle-password:hover {
    background: rgba(37, 99, 235, 0.08);
}

@keyframes alertSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.form-alert {
    width: 100%;
    margin-bottom: 14px;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.92rem;
    font-weight: 500;
    line-height: 1.45;
    border: 1px solid transparent;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    animation: alertSlideDown 0.25s ease;
}

.form-alert.d-none {
    display: none;
}

.form-alert.alert-error {
    background: #fef2f2;
    color: #b91c1c;
    border-color: #fecaca;
}

.form-alert.alert-success {
    background: #ecfdf5;
    color: #15803d;
    border-color: #bbf7d0;
}

.form-alert.alert-warning {
    background: #fffbeb;
    color: #b45309;
    border-color: #fde68a;
}