/* Vista auth pages (login/register) — SaaS-style split screen */

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

:root {
    --vista-primary: #C62828;
    --vista-primary-dark: #A31F1F;
    --vista-teal: #00BFA5;
    --vista-ink: #1f1f30;
    --vista-muted: #7a7a8c;
    --vista-border: #e7e7ef;
}

.vista-auth-topbar {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 20;
    padding: 2rem 2.5rem;
}

.vista-auth-brand img {
    height: 45px;
    width: auto;
    display: block;
}

.vista-auth {
    font-family: 'Montserrat', sans-serif;
    height: 100vh;
    display: flex;
}

.vista-auth__panel {
    flex: 1 1 50%;
    min-width: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    align-items: center;
    align-items: safe center;
    justify-content: center;
    /* Soft mint tinted off the brand teal, replacing the plain #ffffff. Kept
       light on purpose: the copy, inputs and links on this panel are all styled
       for a light ground, so a dark panel would mean restyling every one of
       them. The white form fields now read as raised cards against it. */
    background: #b1decd;
    padding: 8rem 3rem 2.5rem;
}

.vista-auth__form-wrap {
    width: 100%;
    max-width: 460px;
    min-width: 0;
}

/* Pairs fields side by side (Institution/Code, Password/Confirm) to keep
   the register form short enough to fit one viewport without scrolling. */
.vista-auth__form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.vista-auth__form-row .form-group {
    margin-bottom: 0;
}

.vista-auth__title {
    color: var(--vista-ink);
    font-weight: 800;
    font-size: 2rem;
    margin: 0 0 0.4rem;
    position: relative;
    padding-bottom: 0.7rem;
}

.vista-auth__title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 42px;
    height: 4px;
    border-radius: 2px;
    background: var(--vista-teal);
}

.vista-auth__subtitle {
    color: var(--vista-muted);
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
}

.vista-auth .alert-danger {
    background: rgba(198, 40, 40, 0.08);
    border: 1px solid rgba(198, 40, 40, 0.25);
    border-radius: 10px;
    color: #8f1f1f;
    font-size: 0.9rem;
    padding: 0.9rem 1.1rem;
    margin-bottom: 1.5rem;
}

.vista-auth__form .form-group {
    margin-bottom: 1rem;
}

.vista-auth__form label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--vista-ink);
    margin-bottom: 0.3rem;
}

.vista-auth__form .form-control,
.vista-auth__form .form-select {
    border: 1.5px solid var(--vista-border);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 1rem;
    width: 100%;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.vista-auth__form .form-control:focus,
.vista-auth__form .form-select:focus {
    outline: none;
    border-color: var(--vista-teal);
    box-shadow: 0 0 0 4px rgba(0, 191, 165, 0.25);
}

.vista-auth__form .form-control.is-invalid {
    border-color: #dc3545;
}

.vista-auth__form .form-control.is-invalid:focus {
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.2);
}

.vista-auth__row {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1.5rem;
}

.vista-auth__link,
.vista-auth__footer a {
    color: var(--vista-primary);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
}

.vista-auth__link:hover,
.vista-auth__footer a:hover {
    text-decoration: underline;
    color: var(--vista-primary-dark);
}

.btn-vista-primary {
    display: block;
    width: 100%;
    border: none;
    border-radius: 10px;
    padding: 12px;
    background: var(--vista-primary);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.02em;
    transition: background 0.2s ease, transform 0.2s ease;
    margin-bottom: 1rem;
}

.btn-vista-primary:hover {
    background: var(--vista-primary-dark);
    transform: translateY(-1px);
}

.btn-vista-primary:disabled {
    opacity: 0.6;
    transform: none;
}

.vista-auth__footer {
    text-align: center;
    color: var(--vista-muted);
    font-size: 0.9rem;
}

/* Matches the landing hero's right half: brand gradient behind a low-opacity
   campus photo (on ::before, so its opacity doesn't also fade the logos),
   with the MARA & MRSM marks centered on top. */
.vista-auth__cover {
    flex: 1 1 50%;
    position: relative;
    background: linear-gradient(45deg, #00695C 0%, #00897B 50%, #4DB6AC 100%);
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

.vista-auth__cover::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('/images/vista_student.jpeg');
    background-size: cover;
    background-position: center 55%;
    opacity: 1;
    z-index: 0;
}

/* Translucent overlay over the photo, matching the landing hero's
   .hero-photo-half::after so both pages tint the same image identically. Keep
   this colour in sync with that rule in vista-index.css. Sits above the photo
   (z-index 0) and below the caption scrim (z-index 2). */
.vista-auth__cover::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: rgba(31, 164, 147, 0.2);
}

.vista-auth__cover-overlay {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 3rem 3rem 3.5rem;
    background: linear-gradient(to top, rgba(31, 31, 48, 0.88) 0%, rgba(31, 31, 48, 0.35) 55%, rgba(31, 31, 48, 0) 100%);
}

.vista-auth__cover-tagline {
    color: #fff;
    font-size: 1.4rem;
    font-weight: 600;
    line-height: 1.4;
    max-width: 420px;
    margin: 0;
}

/* Password strength meter (register page) */
.password-strength-meter .strength-bar {
    display: flex;
    gap: 4px;
}

.password-strength-meter .strength-fill {
    height: 4px;
    flex: 1;
    border-radius: 2px;
    background: var(--vista-border);
    transition: background 0.2s ease;
}

.password-strength-meter .strength-fill.active {
    background: var(--vista-teal);
}

.password-hint {
    font-size: 0.78rem;
    color: var(--vista-muted);
    margin-top: 0.35rem;
    margin-bottom: 1rem;
}

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

.password-toggle:hover {
    color: var(--vista-ink);
}

.password-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 191, 165, 0.35);
}

.vista-auth__form .form-check {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 1.1rem;
}

.vista-auth__form .form-check-input {
    margin-top: 0.25rem;
}

.vista-auth__form .form-check-label {
    font-size: 0.85rem;
    color: var(--vista-muted);
}

.vista-auth__form .form-check-label a {
    color: var(--vista-primary);
    font-weight: 600;
}

/* Responsive: collapse to single column, hide cover image */
@media (max-width: 991px) {
    .vista-auth {
        height: auto;
        min-height: auto;
    }

    .vista-auth__cover {
        display: none;
    }

    .vista-auth__panel {
        height: auto;
        overflow-y: visible;
        padding: 8rem 1.5rem 3rem;
        min-height: 100vh;
    }
}

@media (max-width: 576px) {
    .vista-auth__form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .vista-auth__form-row .form-group {
        margin-bottom: 1rem;
    }

    .vista-auth__form-row .form-group:last-child {
        margin-bottom: 0;
    }
}

@media (max-width: 480px) {
    .vista-auth-topbar {
        padding: 1.5rem;
    }

    .vista-auth__title {
        font-size: 1.6rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .vista-auth__form .form-control,
    .vista-auth__form .form-select,
    .btn-vista-primary {
        transition: none;
    }
}
