/* ═══════════════════════════════════════════════════════════════════════════
   LAIA – assets/index.css
   Seitenspezifisches Stylesheet für das Laia Einstiegs- & Auth-Portal
   Vollständig basierend auf den Design-Tokens von assets/style_new.css
   Absolute Stabilität & Responsivität ohne horizontales Überlaufen
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Global Box-Sizing & Viewport Reset ─────────────────────────────────── */
html,
body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden !important;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* ── Animated Aurora Ambient Background ─────────────────────────────────── */
.portal-aurora-container {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.portal-aurora-mesh {
    position: absolute;
    inset: -20%;
    width: 140%;
    height: 140%;
    filter: blur(80px);
    opacity: 0.5;
    will-change: transform;
    pointer-events: none;
}

body.dark-mode .portal-aurora-mesh,
html.dark-mode .portal-aurora-mesh {
    opacity: 0.35;
}

.aurora-beam {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    will-change: transform;
}

/* Beam 1: Primary Indigo Glow */
.aurora-beam-1 {
    width: 60vw;
    height: 50vw;
    top: -10%;
    left: -10%;
    background: radial-gradient(circle at center, rgba(99, 102, 241, 0.45) 0%, rgba(79, 70, 229, 0.2) 50%, transparent 75%);
    animation: auroraWave1 22s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}

/* Beam 2: Teal / Emerald Wave */
.aurora-beam-2 {
    width: 55vw;
    height: 55vw;
    bottom: -15%;
    right: -10%;
    background: radial-gradient(circle at center, rgba(20, 184, 166, 0.4) 0%, rgba(16, 185, 129, 0.18) 45%, transparent 70%);
    animation: auroraWave2 26s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}

/* Beam 3: Cyan / Sky Light */
.aurora-beam-3 {
    width: 45vw;
    height: 45vw;
    top: 25%;
    right: 10%;
    background: radial-gradient(circle at center, rgba(56, 189, 248, 0.35) 0%, rgba(99, 102, 241, 0.15) 50%, transparent 70%);
    animation: auroraWave3 19s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}

/* Beam 4: Violet / Deep Radiance */
.aurora-beam-4 {
    width: 48vw;
    height: 48vw;
    bottom: 5%;
    left: 5%;
    background: radial-gradient(circle at center, rgba(139, 92, 246, 0.35) 0%, rgba(99, 102, 241, 0.12) 55%, transparent 75%);
    animation: auroraWave4 25s cubic-bezier(0.4, 0, 0.2, 1) infinite alternate;
}

@keyframes auroraWave1 {
    0% {
        transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
    }

    50% {
        transform: translate3d(8vw, 8vh, 0) rotate(45deg) scale(1.1);
    }

    100% {
        transform: translate3d(3vw, 15vh, 0) rotate(90deg) scale(0.95);
    }
}

@keyframes auroraWave2 {
    0% {
        transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
    }

    50% {
        transform: translate3d(-10vw, -8vh, 0) rotate(-40deg) scale(1.1);
    }

    100% {
        transform: translate3d(-5vw, -15vh, 0) rotate(-80deg) scale(0.92);
    }
}

@keyframes auroraWave3 {
    0% {
        transform: translate3d(0, 0, 0) rotate(0deg) scale(0.92);
    }

    50% {
        transform: translate3d(-12vw, 10vh, 0) rotate(60deg) scale(1.12);
    }

    100% {
        transform: translate3d(-6vw, -8vh, 0) rotate(120deg) scale(1.02);
    }
}

@keyframes auroraWave4 {
    0% {
        transform: translate3d(0, 0, 0) rotate(0deg) scale(1.05);
    }

    50% {
        transform: translate3d(10vw, -10vh, 0) rotate(-55deg) scale(0.9);
    }

    100% {
        transform: translate3d(14vw, 5vh, 0) rotate(-110deg) scale(1.05);
    }
}

@media (prefers-reduced-motion: reduce) {
    .aurora-beam {
        animation: none !important;
    }
}

/* ── Layout & Page Shell ────────────────────────────────────────────────── */
.laia-page {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    padding: 2rem 1.25rem 4rem;
}

.portal-wrapper {
    max-width: 680px;
    margin: 0 auto;
    width: 100%;
    overflow: hidden;
}

/* ── Hero Logo & Header ─────────────────────────────────────────────────── */
.portal-hero-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: var(--sp-3);
    position: relative;
    text-decoration: none;
}

.portal-hero-logo-img {
    height: 46px;
    width: auto;
    max-width: 180px;
    object-fit: contain;
    transition: transform var(--trans-slow);
    filter: drop-shadow(0 4px 12px rgba(99, 102, 241, 0.12));
}

.portal-hero-logo:hover .portal-hero-logo-img {
    transform: scale(1.04);
}

.page-hero {
    margin-bottom: 1.75rem;
}

.page-hero-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    font-weight: var(--fw-extrabold);
    color: var(--text-primary);
    line-height: var(--lh-tight);
    text-align: center;
}

.page-hero-desc {
    max-width: 540px;
    margin: 0.5rem auto 0;
    font-size: var(--fz-sm);
    color: var(--text-secondary);
    line-height: var(--lh-base);
    text-align: center;
}

/* ── Quick-Info Karussell Widget ────────────────────────────────────────── */
.portal-carousel-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: var(--sp-4) var(--sp-5);
    margin-bottom: var(--sp-5);
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    transition: var(--trans);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

body.dark-mode .portal-carousel-card,
html.dark-mode .portal-carousel-card {
    background: rgba(30, 41, 59, 0.85);
    border-color: rgba(99, 102, 241, 0.2);
}

.portal-carousel-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow);
}

.portal-carousel-viewport {
    overflow: hidden;
    position: relative;
    width: 100%;
}

.portal-carousel-track {
    display: flex;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
    width: 100%;
    will-change: transform;
}

.portal-carousel-slide {
    flex: 0 0 100%;
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    overflow: hidden;
}

.portal-carousel-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--r);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.portal-carousel-icon .material-symbols-outlined {
    font-size: 22px;
}

.portal-carousel-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
}

.portal-carousel-title {
    font-size: var(--fz-sm);
    font-weight: var(--fw-bold);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.portal-carousel-desc {
    font-size: var(--fz-xs);
    color: var(--text-secondary);
    line-height: var(--lh-base);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.portal-carousel-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--sp-3);
    padding-top: var(--sp-2);
    border-top: 1px solid var(--border);
}

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

.portal-carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--r-full);
    background: var(--border-solid);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
}

.portal-carousel-dot.active {
    width: 22px;
    background: var(--primary);
    border-radius: var(--r-full);
}

.portal-carousel-arrows {
    display: flex;
    gap: 6px;
}

.portal-carousel-arrow-btn {
    width: 28px;
    height: 28px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border-solid);
    background: var(--surface-elevated);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--trans);
}

.portal-carousel-arrow-btn:hover {
    background: var(--surface-hover);
    color: var(--primary);
    border-color: var(--primary-light);
}

.portal-carousel-arrow-btn .material-symbols-outlined {
    font-size: 16px;
}

/* ── Portal Nav (Segmented Switcher) ────────────────────────────────────── */
.portal-nav-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: var(--surface-elevated);
    border: 1px solid var(--border-strong);
    padding: 4px;
    border-radius: var(--r-xl);
    gap: 4px;
    margin-bottom: var(--sp-5);
    box-shadow: var(--shadow-sm);
    position: relative;
    isolation: isolate;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    width: 100%;
    max-width: 100%;
}

body.dark-mode .portal-nav-bar,
html.dark-mode .portal-nav-bar {
    background: rgba(15, 23, 42, 0.75);
    border-color: var(--border);
}

.portal-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: var(--sp-3) var(--sp-2);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: var(--fz-xs);
    font-weight: var(--fw-semibold);
    border-radius: var(--r-lg);
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    user-select: none;
    text-align: center;
    line-height: var(--lh-tight);
    min-height: 44px;
}

.portal-nav-btn .material-symbols-outlined {
    font-size: var(--icon-md);
    transition: transform 0.2s ease;
}

.portal-nav-btn:hover {
    color: var(--text-primary);
    background: var(--surface-hover);
}

.portal-nav-btn.active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: var(--shadow);
}

body.dark-mode .portal-nav-btn.active,
html.dark-mode .portal-nav-btn.active {
    background: var(--surface-elevated);
    color: var(--primary-light);
    box-shadow: var(--shadow-md);
}

/* ── Tab Panes with Smooth Transitions ──────────────────────────────────── */
.portal-pane {
    display: none;
    opacity: 0;
    transform: translateY(8px) scale(0.99);
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    width: 100%;
}

.portal-pane.active {
    display: block;
    opacity: 1;
    transform: translateY(0) scale(1);
    animation: portalSmoothIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes portalSmoothIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.99);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Main Card ──────────────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: var(--sp-6);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

body.dark-mode .card,
html.dark-mode .card {
    background: var(--surface);
    border-color: var(--border-strong);
}

.card-header-row {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    margin-bottom: var(--sp-5);
    padding-bottom: var(--sp-4);
    border-bottom: 1px solid var(--border);
}

.card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--r);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-title {
    font-size: var(--fz-md);
    font-weight: var(--fw-bold);
    color: var(--text-primary);
    line-height: var(--lh-tight);
}

.card-subtitle {
    font-size: var(--fz-xs);
    color: var(--text-secondary);
    margin-top: 2px;
    line-height: var(--lh-base);
}

/* ── Form Actions & Helper Rows ─────────────────────────────────────────── */
.portal-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--sp-3);
    margin-top: var(--sp-3);
    font-size: var(--fz-sm);
    color: var(--text-secondary);
}

.portal-form-footer a {
    color: var(--primary);
    font-weight: var(--fw-semibold);
    text-decoration: none;
    transition: var(--trans);
}

.portal-form-footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ── Checkbox & Consent Label ───────────────────────────────────────────── */
.portal-check-label {
    display: inline-flex;
    align-items: flex-start;
    gap: var(--sp-2);
    font-size: var(--fz-sm);
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    line-height: var(--lh-base);
    margin-top: var(--sp-1);
}

.portal-check-label input[type="checkbox"] {
    margin-top: 2px;
}

.portal-check-label a {
    color: var(--primary);
    text-decoration: underline;
    font-weight: var(--fw-medium);
}

/* ── Password Visibility Toggle Input Wrapper ───────────────────────────── */
.input-with-action {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-with-action .form-input {
    padding-right: 2.8rem;
}

.input-action-btn {
    position: absolute;
    right: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: var(--trans);
}

.input-action-btn:hover {
    color: var(--text-primary);
    background: var(--surface-hover);
}

.input-action-btn .material-symbols-outlined {
    font-size: var(--icon-sm);
}

/* ── Dynamic Class Secret Transition ────────────────────────────────────── */
.secret-field-transition {
    max-height: 120px;
    opacity: 1;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, margin 0.3s ease;
}

.secret-field-transition.hidden {
    max-height: 0;
    opacity: 0;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    pointer-events: none;
}

/* ── QR-Code Scanner Stage ──────────────────────────────────────────────── */
.qr-scanner-box {
    background: var(--surface-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: var(--sp-4);
    margin-bottom: var(--sp-4);
    transition: var(--trans);
}

.qr-scanner-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-2);
    margin-top: var(--sp-3);
}

.qr-scanner-stage {
    position: relative;
    width: 100%;
    min-height: 240px;
    background: #000;
    border-radius: var(--r);
    overflow: hidden;
    margin-top: var(--sp-3);
    transition: all 0.3s ease;
}

.qr-scanner-stage.hidden {
    display: none !important;
}

.qr-scanner-stage video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.qr-status-msg {
    font-size: var(--fz-xs);
    color: var(--text-secondary);
    padding: var(--sp-2) var(--sp-3);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    margin-top: var(--sp-3);
    line-height: var(--lh-base);
    transition: var(--trans);
}

.qr-status-msg.is-success {
    color: var(--alert-success-text);
    background: var(--success-light);
    border-color: var(--success-border);
}

.qr-status-msg.is-error {
    color: var(--alert-error-text);
    background: var(--danger-light);
    border-color: var(--danger-border);
}

.visually-hidden-file {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ── Registration Sub Switcher ──────────────────────────────────── */
.reg-subnav {
    display: flex;
    background: var(--bg);
    padding: 3px;
    border-radius: var(--r);
    gap: 4px;
    margin-bottom: var(--sp-5);
    border: 1px solid var(--border);
    width: 100%;
}

body.dark-mode .reg-subnav,
html.dark-mode .reg-subnav {
    background: rgba(15, 23, 42, 0.6);
}

.reg-subnav-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-3);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: var(--fz-sm);
    font-weight: var(--fw-semibold);
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 40px;
}

.reg-subnav-btn .material-symbols-outlined {
    font-size: var(--icon-sm);
}

.reg-subnav-btn:hover {
    color: var(--text-primary);
}

.reg-subnav-btn.active {
    background: var(--surface);
    color: var(--text-primary);
    box-shadow: var(--shadow-xs);
}

body.dark-mode .reg-subnav-btn.active,
html.dark-mode .reg-subnav-btn.active {
    background: var(--surface-elevated);
}

/* ── Teacher Registration Dynamic Classes ───────────────────────────────── */
.teacher-class-card {
    background: var(--surface-elevated);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-lg);
    padding: var(--sp-4);
    margin-bottom: var(--sp-4);
    transition: border-color var(--trans);
    animation: teacherCardIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes teacherCardIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.teacher-class-card:hover {
    border-color: var(--primary-light);
}

.teacher-class-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--sp-3);
}

.teacher-class-title {
    font-size: var(--fz-sm);
    font-weight: var(--fw-bold);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}

.teacher-class-title .material-symbols-outlined {
    font-size: var(--icon-sm);
    color: var(--primary);
}

.btn-remove-class {
    background: transparent;
    border: none;
    color: var(--danger);
    cursor: pointer;
    padding: var(--sp-1);
    border-radius: var(--r-xs);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--trans);
}

.btn-remove-class:hover {
    background: var(--danger-light);
}

.btn-remove-class .material-symbols-outlined {
    font-size: var(--icon-sm);
}

.subject-chips-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: var(--sp-2);
}

.subject-chip {
    display: inline-flex;
    align-items: center;
    padding: .35rem .75rem;
    border-radius: var(--r-full);
    font-size: var(--fz-xs);
    font-weight: var(--fw-medium);
    background: var(--surface);
    border: 1px solid var(--border-solid);
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

.subject-chip input[type="checkbox"] {
    display: none;
}

.subject-chip:hover {
    border-color: var(--primary-light);
    color: var(--text-primary);
}

.subject-chip.active {
    background: var(--primary-lighter);
    border-color: var(--primary);
    color: var(--primary-dark);
    font-weight: var(--fw-semibold);
}

body.dark-mode .subject-chip.active,
html.dark-mode .subject-chip.active {
    background: rgba(99, 102, 241, 0.25);
    color: var(--primary-light);
}

.btn-add-class {
    width: 100%;
    min-height: 44px;
    padding: var(--sp-3);
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--r);
    background: transparent;
    color: var(--primary);
    font-family: var(--font);
    font-size: var(--fz-sm);
    font-weight: var(--fw-semibold);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    cursor: pointer;
    transition: all var(--trans);
    margin-bottom: var(--sp-4);
}

.btn-add-class:hover {
    background: var(--primary-lighter);
    border-color: var(--primary);
}

body.dark-mode .btn-add-class:hover,
html.dark-mode .btn-add-class:hover {
    background: rgba(99, 102, 241, 0.12);
}

.btn-add-class .material-symbols-outlined {
    font-size: var(--icon-sm);
}

/* ── Role Selector (Class Registration) ─────────────────────────────────── */
.role-toggle-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--sp-2);
}

.role-toggle-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    min-height: 44px;
    padding: var(--sp-3);
    border: 1.5px solid var(--border-solid);
    border-radius: var(--r);
    background: var(--surface);
    cursor: pointer;
    font-size: var(--fz-sm);
    font-weight: var(--fw-semibold);
    color: var(--text-secondary);
    transition: all 0.2s ease;
    user-select: none;
}

.role-toggle-card input[type="radio"] {
    display: none;
}

.role-toggle-card:hover {
    border-color: var(--primary-light);
    color: var(--text-primary);
}

.role-toggle-card:has(input:checked) {
    background: var(--primary-lighter);
    border-color: var(--primary);
    color: var(--primary-dark);
}

body.dark-mode .role-toggle-card:has(input:checked),
html.dark-mode .role-toggle-card:has(input:checked) {
    background: rgba(99, 102, 241, 0.2);
    color: var(--primary-light);
}

/* ── Top Alert in Card ──────────────────────────────────────────────────── */
.portal-card-alert {
    display: none;
    margin-bottom: var(--sp-4);
    animation: alertSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes alertSlideIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   DEDICATED MOBILE BREAKPOINTS (Smartphones & Tablets <= 640px)
   ═══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
    .laia-page {
        padding: 1.25rem 1rem 3rem !important;
    }

    .portal-hero-logo {
        margin-bottom: var(--sp-2);
    }

    .portal-hero-logo-img {
        height: 38px;
    }

    .page-hero {
        margin-bottom: 1.25rem;
    }

    .page-hero-eyebrow {
        font-size: 0.72rem;
        letter-spacing: 0.06em;
        margin-bottom: 0.2rem;
    }

    .page-hero-title {
        font-size: clamp(1.4rem, 6vw, 1.8rem);
        line-height: 1.2;
        gap: 0.3rem;
    }

    .page-hero-title-icon {
        font-size: 1.4rem;
    }

    .page-hero-desc {
        font-size: 0.82rem;
        line-height: 1.45;
        margin-top: 0.35rem;
        padding: 0;
    }

    /* Carousel mobile layout */
    .portal-carousel-card {
        padding: 0.85rem 1rem;
        margin-bottom: 1.15rem;
        border-radius: var(--r-lg);
    }

    .portal-carousel-slide {
        gap: var(--sp-3);
    }

    .portal-carousel-icon {
        width: 36px;
        height: 36px;
    }

    .portal-carousel-icon .material-symbols-outlined {
        font-size: 19px;
    }

    .portal-carousel-title {
        font-size: 0.82rem;
        gap: 4px;
    }

    .portal-carousel-desc {
        font-size: 0.74rem;
        line-height: 1.35;
    }

    .portal-carousel-controls {
        margin-top: 0.5rem;
        padding-top: 0.4rem;
    }

    .portal-carousel-arrow-btn {
        width: 30px;
        height: 30px;
    }

    /* Nav Bar on Mobile: 2x2 Grid */
    .portal-nav-bar {
        grid-template-columns: repeat(2, 1fr);
        gap: 4px;
        padding: 4px;
        border-radius: var(--r-lg);
        margin-bottom: 1.15rem;
    }

    .portal-nav-btn {
        flex-direction: row;
        justify-content: center;
        align-items: center;
        padding: 0.65rem 0.5rem;
        gap: 0.4rem;
        font-size: 0.82rem;
        border-radius: var(--r-md);
        min-height: 44px;
    }

    .portal-nav-btn .material-symbols-outlined {
        font-size: 18px;
    }

    /* Main Card on Mobile */
    .card {
        padding: 1.25rem 1rem;
        border-radius: var(--r-lg);
    }

    .card-header-row {
        gap: 0.65rem;
        margin-bottom: 1.15rem;
        padding-bottom: 0.75rem;
    }

    .card-icon {
        width: 36px;
        height: 36px;
    }

    .card-icon .material-symbols-outlined {
        font-size: 1.2rem;
    }

    .card-title {
        font-size: 0.94rem;
    }

    .card-subtitle {
        font-size: 0.78rem;
        line-height: 1.35;
    }

    /* Form Fields & iOS Safari Zoom Prevention (16px) */
    .form-group {
        margin-bottom: 0.95rem;
    }

    .form-label {
        font-size: 0.82rem;
        margin-bottom: 0.35rem;
    }

    .form-input,
    .form-select {
        min-height: 44px;
        font-size: 16px;
        padding: 0.65rem 0.85rem;
        border-radius: var(--r-sm);
    }

    .form-select {
        padding-right: 2.2rem;
        background-position: right 0.75rem center;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 0.95rem;
    }

    .btn {
        min-height: 46px;
        font-size: 0.9rem;
        border-radius: var(--r-sm);
    }

    .input-action-btn {
        width: 40px;
        height: 40px;
        right: 2px;
    }

    .portal-form-footer {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.45rem;
        margin-top: 0.75rem;
    }

    .portal-check-label {
        font-size: 0.82rem;
        padding: 4px 0;
    }

    .reg-subnav {
        margin-bottom: 1.15rem;
    }

    .reg-subnav-btn {
        min-height: 40px;
        font-size: 0.82rem;
        padding: 0.45rem 0.5rem;
    }

    .teacher-class-card {
        padding: 0.85rem;
        margin-bottom: 0.85rem;
    }

    .subject-chip {
        padding: 0.35rem 0.7rem;
        font-size: 0.75rem;
    }

    .qr-scanner-box {
        padding: 0.85rem;
    }

    .qr-scanner-buttons {
        grid-template-columns: 1fr;
    }

    .qr-scanner-stage {
        min-height: 200px;
    }

    .modal-box {
        width: calc(100% - 1.5rem);
        max-width: 380px;
        margin: 0 auto;
    }

    .modal-header {
        padding: 1rem 1.15rem 0;
    }

    .modal-body {
        padding: 1rem 1.15rem 1.25rem;
    }

    .laia-footer {
        padding: 1.5rem 1rem 2.5rem;
    }

    .laia-footer-links {
        gap: 0.75rem 1.25rem;
        font-size: 0.78rem;
    }
}