/* Xavier Jesuit School - Student Information System (SIS) Portal Styles */
:root {
    /* Color Guide provided by User */
    --bg-page: #f5f7fa;
    --white: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-light: #e2e8f0;
    --green-x: #29500D;
    --warning-x: #EBAA23;
    --green-light: #e9f2ec;
    --danger: #c50f0f;

    /* Complementary semantic tokens */
    --brand-dark: #0a1b11;
    --brand-dark-forest: #10281b;
    --green-x-hover: #1e3d09;
    --green-x-active: #173007;
    --warning-x-glow: rgba(235, 170, 35, 0.45);
    --warning-x-light: #fef8eb;
    --text-white: #ffffff;
    --text-dim: #cbd5e1;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --font-stack: 'Kantumruy Pro', 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: var(--font-stack);
    background-color: var(--bg-page);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Master 1-Screen Grid (Desktop) */
.portal-shell {
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    display: grid;
    grid-template-columns: 62% 38%;
    overflow: hidden;
}

/* ==========================================================================
   LEFT COLUMN: SYSTEM SHOWCASE & CAROUSEL
   ========================================================================== */
.portal-showcase {
    height: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: radial-gradient(circle at 85% 15%, #183318 0%, #102414 55%, #0a1b11 100%);
    color: var(--text-white);
    padding: clamp(10px, 1.8vh, 20px) clamp(16px, 2.2vw, 34px);
    position: relative;
    isolation: isolate;
    overflow: hidden;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

/* Ambient glow backgrounds */
.showcase-glow {
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
}
.glow-top {
    width: 500px;
    height: 500px;
    top: -160px;
    right: -120px;
    background: radial-gradient(circle, rgba(235, 170, 35, 0.18) 0%, rgba(41, 80, 13, 0.3) 50%, transparent 75%);
    animation: ambientFloat 9s ease-in-out infinite alternate;
}
.glow-bottom {
    width: 440px;
    height: 440px;
    bottom: -180px;
    left: -120px;
    background: radial-gradient(circle, rgba(41, 80, 13, 0.45) 0%, transparent 70%);
    animation: ambientFloat 11s ease-in-out infinite alternate-reverse;
}
@keyframes ambientFloat {
    0% { transform: translate3d(0, 0, 0) scale(1); }
    100% { transform: translate3d(-24px, 18px, 0) scale(1.08); }
}

/* Showcase Header */
.showcase-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-shrink: 0;
    padding-bottom: clamp(4px, 0.9vh, 8px);
}

.showcase-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease;
    min-width: 0;
}
.showcase-brand:hover {
    opacity: 0.92;
}

.brand-logo {
    width: clamp(36px, 4.2vh, 44px);
    height: clamp(36px, 4.2vh, 44px);
    object-fit: contain;
    background: var(--white);
    border-radius: 10px;
    padding: 3px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.school-name {
    font-size: clamp(13.5px, 1.7vh, 16px);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--white);
}

.system-badge {
    font-size: clamp(10px, 1.2vh, 11.5px);
    color: var(--warning-x);
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-top: 1px;
}

.showcase-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    color: #e2ede5;
    backdrop-filter: blur(8px);
    white-space: nowrap;
    flex-shrink: 0;
}

.pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 8px #22c55e;
    animation: status-pulse 2s infinite ease-in-out;
}
@keyframes status-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   CAROUSEL DISPLAY STAGE & 3D ANIMATED SLIDER TRACK
   ========================================================================== */
.carousel-stage {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    padding: clamp(2px, 0.6vh, 8px) 0;
}

.carousel-viewport {
    width: 100%;
    max-width: min(860px, 78vh);
    overflow: hidden;
    position: relative;
    border-radius: var(--radius-md);
    perspective: 1400px;
    padding-bottom: 6px;
}

.carousel-track {
    display: flex;
    width: 100%;
    align-items: flex-start;
    transition: transform 0.78s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
    transform-style: preserve-3d;
}

.carousel-track.no-transition {
    transition: none !important;
}

.carousel-slide {
    flex: 0 0 100%;
    width: 100%;
    min-width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: clamp(6px, 1vh, 10px);
    opacity: 0.18;
    filter: blur(1.5px);
    transform: scale(0.92) translateY(6px) rotateY(-4deg);
    transition: opacity 0.68s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.78s cubic-bezier(0.22, 1, 0.36, 1),
                filter 0.68s ease;
    padding: 2px 4px 10px;
}

.carousel-slide.active {
    opacity: 1;
    filter: blur(0);
    transform: scale(1) translateY(0) rotateY(0deg);
}

/* ==========================================================================
   PHOTO FRAME: Tightly hugs the photo without excess size + Shimmer & Ken Burns
   ========================================================================== */
.photo-frame {
    width: 100%;
    background: #09170e;
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-md);
    box-shadow: 0 18px 42px -8px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(235, 170, 35, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.4s ease, border-color 0.4s ease, transform 0.4s ease;
    position: relative;
}
.carousel-slide.active .photo-frame {
    animation: frameSpringIn 0.78s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes frameSpringIn {
    0% {
        transform: translateY(14px) scale(0.96);
    }
    100% {
        transform: translateY(0) scale(1);
    }
}
.photo-frame:hover {
    border-color: rgba(235, 170, 35, 0.48);
    box-shadow: 0 22px 52px -8px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(235, 170, 35, 0.4);
}

.photo-top-bar {
    min-height: 28px;
    background: #06110a;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 3px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-shrink: 0;
}

.window-dots {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.w-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}
.w-dot.red { background: #ff5f56; }
.w-dot.yellow { background: #ffbd2e; }
.w-dot.green { background: #22c55e; }

.window-url {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #92ab9b;
    background: rgba(0, 0, 0, 0.35);
    padding: 2px 10px;
    border-radius: 5px;
    font-size: 10.5px;
    font-family: monospace;
    letter-spacing: 0.02em;
    max-width: clamp(180px, 48vw, 450px);
    min-width: 0;
    flex: 0 1 auto;
    overflow: hidden;
    white-space: nowrap;
}
.window-url span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}
.carousel-slide.active .window-url {
    animation: topBarSlideIn 0.55s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}
.window-url i {
    color: var(--warning-x);
    font-size: 10px;
    flex-shrink: 0;
}

.window-pill {
    background: rgba(235, 170, 35, 0.15);
    color: var(--warning-x);
    border: 1px solid rgba(235, 170, 35, 0.35);
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: 0.02em;
    white-space: nowrap;
    flex-shrink: 0;
}
.carousel-slide.active .window-pill {
    animation: topBarSlideIn 0.55s cubic-bezier(0.16, 1, 0.3, 1) 0.16s both;
}
@keyframes topBarSlideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.photo-canvas {
    width: 100%;
    line-height: 0;
    background: #000000;
    overflow: hidden;
    position: relative;
}

/* Glossy light sweep across active screenshot */
.photo-canvas::after {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 65%;
    height: 100%;
    background: linear-gradient(
        105deg,
        transparent 20%,
        rgba(255, 255, 255, 0.14) 50%,
        transparent 80%
    );
    transform: skewX(-20deg);
    pointer-events: none;
    z-index: 2;
}
.carousel-slide.active .photo-canvas::after {
    animation: shimmerSweep 1.15s cubic-bezier(0.22, 1, 0.36, 1) 0.18s forwards;
}
@keyframes shimmerSweep {
    0% { left: -120%; }
    100% { left: 160%; }
}

.photo-img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 1910 / 960;
    object-fit: cover;
    object-position: top center;
    user-select: none;
    -webkit-user-drag: none;
    transform: scale(1.04);
    transition: transform 0.7s ease;
    will-change: transform;
}
.carousel-slide.active .photo-img {
    animation: kenBurnsMotion 4.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes kenBurnsMotion {
    0% {
        transform: scale(1.045);
    }
    100% {
        transform: scale(1);
    }
}

/* ==========================================================================
   SLIDE META DETAILS & STAGGERED TEXT ENTRANCE ANIMATIONS
   ========================================================================== */
.slide-meta {
    display: flex;
    flex-direction: column;
    gap: clamp(3px, 0.7vh, 6px);
}

.meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.meta-category {
    font-size: clamp(10px, 1.15vh, 11.5px);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--warning-x);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.meta-category i {
    font-size: 11px;
    display: inline-block;
}
.carousel-slide.active .meta-category {
    animation: categorySlideIn 0.52s cubic-bezier(0.16, 1, 0.3, 1) 0.06s both;
}
.carousel-slide.active .meta-category i {
    animation: starPulseSpin 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.14s both;
}
@keyframes categorySlideIn {
    from { opacity: 0; transform: translateX(-14px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes starPulseSpin {
    0% { transform: rotate(-90deg) scale(0.4); opacity: 0; }
    100% { transform: rotate(0deg) scale(1); opacity: 1; }
}

.slide-title {
    font-size: clamp(16px, 2.1vh, 21px);
    font-weight: 700;
    color: var(--white);
    margin: 0;
    line-height: 1.32;
    letter-spacing: -0.01em;
}

.slide-description {
    font-size: clamp(11.5px, 1.3vh, 13px);
    line-height: 1.55;
    color: var(--text-dim);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.slide-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 8px;
    margin-top: 2px;
    padding-bottom: 4px;
}

.feature-pill {
    font-size: clamp(10.5px, 1.18vh, 12px);
    line-height: 1.45;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #e2e8f0;
    padding: 3.5px 11px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.feature-pill:hover {
    background: rgba(235, 170, 35, 0.16);
    border-color: rgba(235, 170, 35, 0.4);
    transform: translateY(-1px);
}
.feature-pill i {
    color: var(--warning-x);
    font-size: 11px;
}

/* Staggered Entrance Animations for Active Slide Text & Pills */
.carousel-slide.active .slide-title {
    animation: metaEntrance 0.58s cubic-bezier(0.16, 1, 0.3, 1) 0.12s both;
}
.carousel-slide.active .slide-description {
    animation: metaEntrance 0.58s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}
.carousel-slide.active .feature-pill:nth-child(1) {
    animation: pillPopIn 0.52s cubic-bezier(0.34, 1.56, 0.64, 1) 0.26s both;
}
.carousel-slide.active .feature-pill:nth-child(2) {
    animation: pillPopIn 0.52s cubic-bezier(0.34, 1.56, 0.64, 1) 0.33s both;
}
.carousel-slide.active .feature-pill:nth-child(3) {
    animation: pillPopIn 0.52s cubic-bezier(0.34, 1.56, 0.64, 1) 0.40s both;
}
.carousel-slide.active .feature-pill:nth-child(n+4) {
    animation: pillPopIn 0.52s cubic-bezier(0.34, 1.56, 0.64, 1) 0.46s both;
}
@keyframes metaEntrance {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes pillPopIn {
    from {
        opacity: 0;
        transform: translateY(5px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ==========================================================================
   CAROUSEL FOOTER CONTROLS & LIVE AUTOPLAY PROGRESS
   ========================================================================== */
.showcase-footer {
    padding-top: clamp(6px, 1.1vh, 12px);
    border-top: 1px solid rgba(255, 255, 255, 0.09);
    flex-shrink: 0;
}

/* Autoplay Progress Line */
.autoplay-track {
    width: 100%;
    height: 3.5px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: clamp(6px, 1vh, 10px);
}

.autoplay-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--warning-x), #fed77f);
    box-shadow: 0 0 12px var(--warning-x-glow);
    border-radius: 999px;
    will-change: width;
}

.carousel-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.carousel-dots {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.nav-dot {
    width: 8px;
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.22);
    border: none;
    padding: 0;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: width 0.38s cubic-bezier(0.22, 1, 0.36, 1),
                background 0.25s ease,
                box-shadow 0.25s ease;
}
.nav-dot:hover {
    background: rgba(255, 255, 255, 0.5);
}
.nav-dot.active {
    width: 30px;
    background: rgba(235, 170, 35, 0.28);
    box-shadow: 0 0 12px var(--warning-x-glow);
}
.nav-dot.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--dot-progress, 100%);
    background: var(--warning-x);
    border-radius: 4px;
}

.carousel-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.slide-counter {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    font-family: monospace;
    display: inline-block;
}
.slide-counter.pop {
    animation: counterPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes counterPop {
    0% { transform: translateY(5px) scale(0.9); opacity: 0.5; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}
.counter-slash {
    color: rgba(255, 255, 255, 0.25);
    margin: 0 2px;
}

.arrow-buttons {
    display: flex;
    gap: 6px;
}

.arrow-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.22s ease;
    font-size: 12px;
}
.arrow-btn:hover {
    background: var(--warning-x);
    border-color: var(--warning-x);
    color: var(--brand-dark);
    transform: scale(1.08);
}
.arrow-btn:active {
    transform: scale(0.94);
}

/* ==========================================================================
   RIGHT COLUMN: LOGIN FORM & AUTH PORTAL
   ========================================================================== */
.portal-auth {
    height: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: var(--bg-page);
    padding: clamp(12px, 2vh, 26px) clamp(20px, 3.2vw, 48px);
    position: relative;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

/* Auth Top Navigation */
.auth-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-shrink: 0;
}

.website-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s ease;
}
.website-link:hover {
    color: var(--green-x);
}
.website-link i.small-arrow {
    font-size: 10px;
    opacity: 0.8;
}

.lang-selector {
    display: flex;
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 3px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
}

.lang-opt {
    display: grid;
    place-items: center;
    min-width: 44px;
    min-height: 30px;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
}
.lang-opt:hover {
    color: var(--green-x);
}
.lang-opt.active {
    background: var(--green-light);
    color: var(--green-x);
    font-weight: 800;
    border: 1px solid rgba(41, 80, 13, 0.15);
    box-shadow: 0 1px 3px rgba(41, 80, 13, 0.08);
}

/* Centered Login Card Area */
.auth-center {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(4px, 1vh, 12px) 0;
}

.auth-card {
    width: 100%;
    max-width: 385px;
    margin: 0 auto;
}

/* Emblem / School Logo */
.auth-emblem {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: clamp(8px, 1.3vh, 16px);
}

.auth-emblem-logo {
    width: clamp(42px, 5.2vh, 50px);
    height: clamp(42px, 5.2vh, 50px);
    object-fit: contain;
    background: var(--white);
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-md);
    padding: 4px;
    box-shadow: 0 4px 14px rgba(30, 41, 59, 0.06);
}

/* Auth Header */
.auth-header {
    text-align: center;
    margin-bottom: clamp(10px, 1.6vh, 20px);
}

.auth-scope {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: var(--green-x);
    text-transform: uppercase;
    margin-bottom: 3px;
}

.auth-title {
    font-size: clamp(20px, 2.5vh, 26px);
    font-weight: 800;
    color: var(--text-main);
    line-height: 1.3;
    margin: 0 0 5px 0;
    letter-spacing: -0.02em;
}

.accent-dot {
    color: var(--warning-x);
}

.auth-subtitle {
    font-size: clamp(11.5px, 1.35vh, 12.5px);
    line-height: 1.5;
    color: var(--text-muted);
    margin: 0;
}

/* Form Alerts */
.form-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 13px;
    border-radius: var(--radius-sm);
    font-size: 11.5px;
    line-height: 1.45;
    margin-bottom: 14px;
    animation: alert-pop 0.3s ease;
}
@keyframes alert-pop {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-alert.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: var(--danger);
}
.form-alert.error i {
    color: var(--danger);
    font-size: 13px;
    margin-top: 1px;
}

.form-alert.status {
    background: var(--green-light);
    border: 1px solid #c2dec9;
    color: var(--green-x);
}
.form-alert.status i {
    color: var(--green-x);
    font-size: 13px;
    margin-top: 1px;
}

/* Form Groups & Inputs */
.form-group {
    margin-bottom: clamp(8px, 1.3vh, 14px);
}

.form-label {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 5px;
}

.label-split {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 5px;
}
.label-split .form-label {
    margin-bottom: 0;
}

.forgot-link {
    font-size: 11px;
    font-weight: 600;
    color: var(--green-x);
    text-decoration: none;
    transition: color 0.15s ease;
}
.forgot-link:hover {
    color: var(--warning-x);
    text-decoration: underline;
}

.field-control {
    position: relative;
    display: flex;
    align-items: center;
}

.field-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 15px;
    pointer-events: none;
}

.field-control input {
    width: 100%;
    height: clamp(40px, 4.6vh, 46px);
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--white);
    padding: 0 40px 0 40px;
    font-family: inherit;
    font-size: 13px;
    color: var(--text-main);
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}
.field-control input::placeholder {
    color: #94a3b8;
    font-size: 12px;
}
.field-control input:focus {
    border-color: var(--green-x);
    outline: 3px solid rgba(41, 80, 13, 0.15);
    outline-offset: 0;
    box-shadow: 0 2px 8px rgba(41, 80, 13, 0.08);
}
.field-control input[aria-invalid="true"] {
    border-color: var(--danger);
    background-color: #fef2f2;
}

.password-toggle {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    display: grid;
    place-items: center;
    cursor: pointer;
    border-radius: 6px;
    font-size: 15px;
    transition: color 0.15s ease;
}
.password-toggle:hover {
    color: var(--green-x);
}

/* Form Auxiliaries (Remember me) */
.form-aux {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: clamp(3px, 0.6vh, 8px) 0 clamp(10px, 1.5vh, 16px);
}

.checkbox-container {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    user-select: none;
}

.checkbox-container input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--green-x);
    border-radius: 4px;
    cursor: pointer;
    margin: 0;
}

.checkbox-label {
    font-size: 11.5px;
    font-weight: 500;
    color: var(--text-main);
}

/* reCAPTCHA Human Verification Widget */
.recaptcha-group {
    margin-bottom: clamp(10px, 1.4vh, 16px);
}

.recaptcha-card {
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    cursor: pointer;
    user-select: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.recaptcha-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}
.recaptcha-card:focus-visible {
    outline: 2px solid var(--green-x);
    outline-offset: 1px;
}
.recaptcha-card.shake {
    animation: recaptchaShake 0.4s ease;
    border-color: var(--danger);
}
@keyframes recaptchaShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

.recaptcha-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.recaptcha-checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    background: var(--white);
    display: grid;
    place-items: center;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.recaptcha-card:hover .recaptcha-checkbox {
    border-color: var(--green-x);
}

.recaptcha-spin {
    display: none;
    width: 14px;
    height: 14px;
    border: 2px solid var(--green-x);
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.65s linear infinite;
}

.recaptcha-check {
    display: none;
    color: var(--green-x);
    font-size: 17px;
    font-weight: 900;
}

.recaptcha-card.verifying .recaptcha-spin {
    display: block;
}
.recaptcha-card.verified .recaptcha-checkbox {
    border-color: var(--green-x);
    background: var(--green-light);
}
.recaptcha-card.verified .recaptcha-check {
    display: block;
    animation: checkPop 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes checkPop {
    from { transform: scale(0.4); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.recaptcha-prompt {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.recaptcha-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
    margin-left: 8px;
}
.recaptcha-icon {
    display: block;
}
.recaptcha-text {
    font-size: 8.5px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.02em;
    line-height: 1;
    margin-top: 2px;
}
.recaptcha-terms {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 7.5px;
    color: var(--text-muted);
    line-height: 1;
    margin-top: 2px;
}
.recaptcha-terms a {
    color: inherit;
    text-decoration: none;
}
.recaptcha-terms a:hover {
    text-decoration: underline;
}

.recaptcha-alert-msg {
    margin-top: 5px;
    font-size: 11px;
    color: var(--danger);
    display: flex;
    align-items: center;
    gap: 5px;
    animation: alert-pop 0.25s ease;
}
.recaptcha-alert-msg i {
    font-size: 12px;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    height: clamp(42px, 4.8vh, 46px);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--green-x);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(41, 80, 13, 0.28);
    transition: all 0.22s ease;
    text-decoration: none;
}
.submit-btn:hover {
    background: var(--green-x-hover);
    box-shadow: 0 6px 18px rgba(41, 80, 13, 0.38);
    transform: translateY(-1px);
}
.submit-btn:active {
    background: var(--green-x-active);
    transform: translateY(0);
}
.submit-btn:disabled {
    opacity: 0.75;
    cursor: wait;
    transform: none;
}

.btn-arrow {
    font-size: 13px;
    transition: transform 0.2s ease;
}
.submit-btn:hover .btn-arrow {
    transform: translateX(3px);
}

/* Already Logged In Panel */
.already-logged-in {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.logged-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--green-light);
    padding: 11px 15px;
    border-radius: var(--radius-sm);
    border: 1px solid #c2dec9;
}
.logged-user-info i {
    font-size: 26px;
    color: var(--green-x);
}
.logged-user-info strong {
    display: block;
    font-size: 13.5px;
    color: var(--text-main);
}
.logged-user-info small {
    display: block;
    font-size: 11.5px;
    color: var(--text-muted);
}

/* PWA / App Install Trigger Button */
.install-app-wrap {
    margin-top: 12px;
}

.install-app-btn {
    width: 100%;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    border: 1.5px dashed rgba(41, 80, 13, 0.45);
    background: #f0fdf4;
    color: var(--green-x);
    font-family: inherit;
    font-weight: 700;
    font-size: 12.5px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.install-app-btn:hover {
    background: #dcfce7;
    border-color: var(--green-x);
    transform: translateY(-1px);
}
.install-app-btn:active {
    transform: translateY(0);
}
.install-app-icon {
    color: #d97706;
    font-size: 15px;
}

/* Support Contact Box */
.auth-support {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-top: clamp(10px, 1.4vh, 18px);
    padding-top: clamp(8px, 1.2vh, 14px);
    border-top: 1px solid var(--border-light);
    color: var(--text-muted);
}
.auth-support i {
    font-size: 15px;
    color: var(--green-x);
    margin-top: 2px;
    flex-shrink: 0;
}
.support-text {
    font-size: 11px;
    line-height: 1.5;
    margin: 0;
    color: var(--text-muted);
}

/* Auth Footer */
.auth-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: clamp(4px, 0.8vh, 10px);
    flex-shrink: 0;
}

.security-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 0.01em;
}
.security-badge i {
    color: var(--green-x);
    font-size: 11.5px;
}

/* Mobile-only App Hero Banner (Hidden on Desktop) */
.mobile-app-hero {
    display: none;
}

/* ==========================================================================
   RESPONSIVENESS & ADAPTIVE BREAKPOINTS
   ========================================================================== */

/* Compact Laptops (height <= 760px) */
@media (min-width: 992px) and (max-height: 760px) {
    .portal-showcase {
        padding: 8px 24px;
    }
    .portal-auth {
        padding: 10px 32px;
    }
    .carousel-viewport {
        max-width: min(760px, 72vh);
    }
    .slide-description {
        -webkit-line-clamp: 1;
    }
}

/* Tablets and Mobile (< 992px): Professional Native Mobile App Login (No Carousel) */
@media (max-width: 991.98px) {
    html {
        height: auto;
        overflow-x: hidden;
        overflow-y: auto;
    }
    body {
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        overflow-x: hidden;
        overflow-y: visible;
        background-color: #f1f5f9;
        position: relative;
    }
    /* Curved Dark-Green App Header Backdrop (includes iPhone status bar & Dynamic Island safe area) */
    body::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: calc(226px + max(env(safe-area-inset-top, 0px), 46px));
        background:
            radial-gradient(circle at 85% 12%, rgba(235, 170, 35, 0.22) 0%, transparent 48%),
            radial-gradient(circle at 15% 20%, rgba(56, 118, 20, 0.42) 0%, transparent 55%),
            linear-gradient(160deg, #1b3b11 0%, #102514 55%, #0a1b11 100%);
        border-radius: 0 0 34px 34px;
        box-shadow: 0 12px 32px rgba(10, 27, 17, 0.18);
        z-index: 0;
        pointer-events: none;
    }
    body::after {
        content: '';
        position: absolute;
        top: calc(224px + max(env(safe-area-inset-top, 0px), 46px));
        left: 16%;
        right: 16%;
        height: 2px;
        background: linear-gradient(90deg, transparent, rgba(235, 170, 35, 0.65), transparent);
        z-index: 0;
        pointer-events: none;
    }

    /* Hide the Carousel Showcase completely on Mobile & Tablet */
    .portal-showcase {
        display: none !important;
    }

    .portal-shell {
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        max-height: none;
        display: flex;
        flex-direction: column;
        overflow: visible;
        position: relative;
        z-index: 1;
    }
    .portal-auth {
        order: 1;
        flex: 1;
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        max-height: none;
        /* Safe top offset clears iPhone status bar / battery / notch / Dynamic Island (min 52px) */
        padding-top: calc(max(env(safe-area-inset-top, 0px), 46px) + 6px);
        padding-left: max(env(safe-area-inset-left, 0px), 16px);
        padding-right: max(env(safe-area-inset-right, 0px), 16px);
        padding-bottom: max(calc(env(safe-area-inset-bottom, 0px) + 10px), 16px);
        overflow: visible;
        background: transparent;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        gap: 8px;
    }

    /* Top App Utility Bar (over dark green hero) */
    .auth-top {
        max-width: 430px;
        width: 100%;
        margin: 0 auto;
    }
    .website-link {
        background: rgba(255, 255, 255, 0.12);
        border: 1px solid rgba(255, 255, 255, 0.20);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        padding: 7px 13px;
        border-radius: 999px;
        font-size: 11.5px;
        font-weight: 600;
        color: #ffffff;
    }
    .website-link:hover {
        color: var(--warning-x);
        background: rgba(255, 255, 255, 0.18);
    }
    .website-link i:first-child {
        color: var(--warning-x);
    }
    .lang-selector {
        background: rgba(10, 27, 17, 0.45);
        border: 1px solid rgba(255, 255, 255, 0.18);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-radius: 999px;
        padding: 3px;
    }
    .lang-opt {
        color: rgba(255, 255, 255, 0.78);
        border-radius: 999px;
        min-width: 44px;
        min-height: 28px;
        font-size: 11.5px;
    }
    .lang-opt:hover {
        color: #ffffff;
    }
    .lang-opt.active {
        background: var(--warning-x);
        color: #0a1b11;
        font-weight: 800;
        border-color: transparent;
        box-shadow: 0 2px 8px rgba(235, 170, 35, 0.35);
    }

    /* Mobile App Hero Brand Section */
    .mobile-app-hero {
        display: flex;
        align-items: center;
        gap: 13px;
        max-width: 430px;
        width: 100%;
        margin: 2px auto 4px;
        padding: 4px 4px;
    }
    .mobile-hero-logo-wrap {
        width: 56px;
        height: 56px;
        border-radius: 16px;
        background: #ffffff;
        padding: 4px;
        box-shadow:
            0 8px 20px rgba(0, 0, 0, 0.28),
            0 0 0 2px rgba(235, 170, 35, 0.55);
        flex-shrink: 0;
        display: grid;
        place-items: center;
    }
    .mobile-hero-logo {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
    .mobile-hero-text {
        display: flex;
        flex-direction: column;
        gap: 4px;
        min-width: 0;
    }
    .mobile-hero-school {
        font-size: 16.5px;
        font-weight: 800;
        color: #ffffff;
        line-height: 1.28;
        letter-spacing: -0.01em;
        text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    }
    .mobile-hero-system {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        align-self: flex-start;
        background: rgba(235, 170, 35, 0.16);
        border: 1px solid rgba(235, 170, 35, 0.38);
        padding: 2.5px 10px;
        border-radius: 999px;
        font-size: 10.5px;
        font-weight: 700;
        color: #fde68a;
        letter-spacing: 0.01em;
    }
    .mobile-hero-dot {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: #22c55e;
        box-shadow: 0 0 6px #22c55e;
        flex-shrink: 0;
    }

    /* Elevated App Login Card Sheet */
    .auth-center {
        padding: 0;
        flex: 1;
        display: flex;
        align-items: flex-start;
        justify-content: center;
    }
    .auth-card {
        max-width: 430px;
        background: var(--white);
        border: 1px solid rgba(226, 232, 240, 0.95);
        border-radius: 24px;
        padding: 22px 20px 20px;
        box-shadow:
            0 20px 44px -12px rgba(15, 23, 42, 0.14),
            0 4px 14px -2px rgba(15, 23, 42, 0.05);
        position: relative;
    }
    /* Hide duplicate logo inside card on mobile since it's in the App Hero above */
    .auth-emblem {
        display: none;
    }
    .auth-header {
        text-align: left;
        margin-bottom: 13px;
        padding-bottom: 10px;
        border-bottom: 1px solid #f1f5f9;
    }
    .auth-scope {
        display: inline-block;
        background: var(--green-light);
        color: var(--green-x);
        padding: 3px 9px;
        border-radius: 6px;
        font-size: 10px;
        font-weight: 800;
        letter-spacing: 0.06em;
        margin-bottom: 5px;
    }
    .auth-title {
        font-size: 20px;
        margin: 0 0 3px 0;
    }
    .auth-subtitle {
        font-size: 11.5px;
        line-height: 1.45;
    }
    .form-group {
        margin-bottom: 10px;
    }
    .field-control input {
        height: 44px;
        font-size: 14px;
        border-radius: 12px;
        background: #f8fafc;
    }
    .field-control input:focus {
        background: var(--white);
    }
    .form-aux {
        margin: 3px 0 10px;
    }
    .recaptcha-group {
        margin-bottom: 12px;
    }
    .recaptcha-card {
        border-radius: 12px;
        padding: 8px 12px;
        background: #f8fafc;
    }
    .submit-btn {
        height: 46px;
        font-size: 14px;
        border-radius: 12px;
        background: linear-gradient(135deg, #29500D 0%, #1e3d09 100%);
        box-shadow: 0 6px 18px rgba(41, 80, 13, 0.30);
    }
    .install-app-wrap {
        margin-top: 9px;
    }
    .install-app-btn {
        min-height: 40px;
        border-radius: 12px;
        font-size: 12px;
        padding: 7px 14px;
    }
    .auth-support {
        margin-top: 10px;
        padding-top: 9px;
    }
    .auth-footer {
        padding-top: 2px;
    }
}

/* Small Phones (< 576px) */
@media (max-width: 575.98px) {
    .portal-auth {
        padding-top: calc(max(env(safe-area-inset-top, 0px), 46px) + 6px);
        padding-left: max(env(safe-area-inset-left, 0px), 14px);
        padding-right: max(env(safe-area-inset-right, 0px), 14px);
        padding-bottom: max(calc(env(safe-area-inset-bottom, 0px) + 10px), 14px);
    }
    .auth-card {
        padding: 18px 18px 16px;
        border-radius: 22px;
    }
    .mobile-hero-logo-wrap {
        width: 50px;
        height: 50px;
        border-radius: 14px;
    }
    .mobile-hero-school {
        font-size: 15.5px;
    }
}
