/* ==============================================================================
   LKiz Sensation — PWA iOS Design System & Styles
   Palette officielle : LKiz Violet (#4527A0), LKiz Magenta (#FF007A)
   Mode Dark immersif, Glassmorphism, Safe Areas Apple iOS
   ============================================================================== */

:root {
    color-scheme: dark;
    --bg-base: var(--bg-dark);
    --chrome-background: rgba(18, 17, 26, 0.94);
    --bg-dark: #12111A;
    --bg-card: rgba(30, 27, 46, 0.85);
    --bg-card-hover: rgba(39, 35, 60, 0.95);
    --surface-glass: rgba(255, 255, 255, 0.04);
    --border-glass: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(255, 0, 122, 0.3);

    --lkiz-violet: #4527A0;
    --lkiz-violet-light: #673AB7;
    --lkiz-magenta: #FF007A;
    --lkiz-magenta-glow: rgba(255, 0, 122, 0.4);

    --text-primary: #FFFFFF;
    --text-secondary: #A6A3C0;
    --text-muted: #ABA7C3;

    --status-success: #00E676;
    --status-warning: #FFB300;
    --status-danger: #FF3D71;

    --tabbar-height: 64px;
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --font-stack: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

:root[data-theme="light"] {
    color-scheme: light;
    --bg-dark: #F6F4FA;
    --bg-card: #FFFFFF;
    --bg-card-hover: #F0EAF8;
    --chrome-background: rgba(255, 255, 255, 0.96);
    --surface-glass: rgba(69, 39, 160, 0.04);
    --border-glass: rgba(50, 30, 90, 0.18);
    --text-primary: #241A36;
    --text-secondary: #574B6C;
    --text-muted: #675A78;
    --lkiz-magenta: #B50057;
    --lkiz-cyan: #006C99;
    --status-success: #087744;
    --status-warning: #875000;
    --status-danger: #BC1741;
}

[hidden] { display: none !important; }
button:focus-visible, select:focus-visible, a:focus-visible {
    outline: 3px solid var(--lkiz-magenta);
    outline-offset: 3px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    user-select: none;
}

input, textarea, select {
    user-select: text;
}

html, body {
    width: 100%;
    height: 100%;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-stack);
    overflow: hidden;
    position: fixed;
}

body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* ==============================================================================
   Layout & Safe Areas (iPhone Dynamic Island / Notch & Home Indicator)
   ============================================================================== */

.app-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    background-color: var(--bg-dark);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
}

.app-header {
    padding-top: max(env(safe-area-inset-top), 16px);
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--chrome-background);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-glass);
    z-index: 100;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-brand-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(69, 39, 160, 0.5);
}

.app-brand-text {
    display: flex;
    flex-direction: column;
}

.app-brand-title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.3px;
    background: linear-gradient(135deg, #FFFFFF 40%, var(--lkiz-magenta) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.app-brand-subtitle {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    background: rgba(69, 39, 160, 0.3);
    border: 1px solid rgba(103, 58, 183, 0.5);
    color: #D1C4E9;
}

/* ==============================================================================
   iOS Installation Banner (Dismissible)
   ============================================================================== */

.ios-install-banner {
    background: linear-gradient(135deg, rgba(69, 39, 160, 0.95), rgba(255, 0, 122, 0.85));
    padding: 12px 16px;
    margin: 12px 16px 0 16px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 8px 24px rgba(255, 0, 122, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: fadeIn 0.4s ease;
}

.ios-install-text {
    font-size: 13px;
    font-weight: 500;
    color: #FFFFFF;
    line-height: 1.35;
}

.ios-install-text strong {
    font-weight: 700;
    text-decoration: underline;
}

.ios-install-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #FFFFFF;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: 10px;
}

/* ==============================================================================
   Main Scrollable Content Area
   ============================================================================== */

.app-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
    padding-bottom: calc(var(--tabbar-height) + max(env(safe-area-inset-bottom), 16px) + 24px);
}

.tab-view {
    display: none;
    animation: viewFadeIn 0.25s ease forwards;
}

.tab-view.active {
    display: block;
}

@keyframes viewFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ==============================================================================
   Cards & Glassmorphism Surfaces
   ============================================================================== */

.lkiz-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 18px;
    margin-bottom: 16px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    position: relative;
    overflow: hidden;
}

.lkiz-card-accent {
    border-left: 4px solid var(--lkiz-magenta);
}

.lkiz-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.lkiz-card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.lkiz-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-active {
    background: rgba(0, 230, 118, 0.15);
    color: var(--status-success);
    border: 1px solid rgba(0, 230, 118, 0.4);
}

.badge-magenta {
    background: rgba(255, 0, 122, 0.15);
    color: var(--lkiz-magenta);
    border: 1px solid rgba(255, 0, 122, 0.4);
}

.badge-violet {
    background: rgba(69, 39, 160, 0.25);
    color: #D1C4E9;
    border: 1px solid rgba(103, 58, 183, 0.4);
}

/* ==============================================================================
   News View (Actualités & Soirées)
   ============================================================================== */

.news-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

.news-card:active {
    transform: scale(0.985);
}

.news-card-img-wrap {
    border: 0;
    padding: 0;
    cursor: zoom-in;
    position: relative;
    width: 100%;
    height: 220px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 18px 18px 0 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-card-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: transparent;
    transition: opacity 0.3s ease;
}

.news-card-img-wrap:focus-visible { outline: 3px solid var(--lkiz-magenta); outline-offset: -3px; }
.news-card-img-wrap:disabled { cursor: wait; }
.news-card-img-wrap::after { content: '⛶'; position: absolute; right: 12px; bottom: 12px; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: #09090dbb; color: white; font-size: 25px; pointer-events: none; }
.news-card-img-wrap:disabled::after { display: none; }
.news-photo-viewer { position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #09090d; color: white; overflow: hidden; }
.news-photo-viewer[open] { display: flex; flex-direction: column; }
.news-photo-viewer::backdrop { background: #09090d; }
.news-photo-toolbar { display: flex; align-items: center; gap: 8px; flex-shrink: 0; padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left)); border-bottom: 1px solid #ffffff20; }
.news-photo-toolbar button { min-width: 44px; min-height: 44px; border: 1px solid #ffffff30; border-radius: 12px; background: #ffffff12; color: white; font: inherit; font-size: 22px; cursor: pointer; }
.news-photo-toolbar button:focus-visible { outline: 2px solid white; outline-offset: 3px; }
.news-photo-toolbar button:disabled { opacity: .35; cursor: default; }
#newsPhotoReset { padding: 0 12px; font-size: 14px; }
.news-photo-close { margin-left: auto; }
.news-photo-stage { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; touch-action: pan-x pan-y pinch-zoom; padding-bottom: env(safe-area-inset-bottom); }
.news-photo-image-space { display: grid; place-items: center; min-width: 100%; min-height: 100%; width: max-content; height: max-content; }
#newsPhotoImage { display: block; max-width: none; max-height: none; object-fit: contain; }
#newsPhotoImage[hidden] { display: none; }

.news-img-loader {
    position: absolute;
    width: 28px;
    height: 28px;
    border: 3px solid rgba(255, 0, 122, 0.2);
    border-top-color: var(--lkiz-magenta);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    pointer-events: none;
}

.news-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.news-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.news-card-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-primary);
    line-height: 1.35;
    text-align: center;
}

.news-event-countdown {
    font-size: 13px;
    font-weight: 700;
    color: #AB47BC;
    margin-bottom: 4px;
}

.news-event-date {
    font-size: 13px;
    font-weight: 700;
    color: var(--lkiz-cyan, #00B0FF);
    margin-bottom: 8px;
}

.news-card-address {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    font-size: 13px;
    color: var(--lkiz-cyan, #00B0FF);
    text-decoration: underline;
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.news-card-address:hover {
    background: rgba(255, 255, 255, 0.1);
}

.news-tarif-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 8px;
    background: rgba(255, 0, 122, 0.12);
    color: var(--lkiz-magenta);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 8px;
}

.news-card-content {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 12px;
    text-align: center;
    word-break: break-word;
}

.news-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    width: 100%;
    padding-top: 10px;
    border-top: 1px solid var(--border-glass);
}

.news-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s ease;
}

.news-link-btn.btn-fb {
    border: 1px solid #1E88E5;
    color: #1E88E5;
    background: rgba(30, 136, 229, 0.08);
}

.news-link-btn.btn-insta {
    border: 1px solid #FF007A;
    color: #FF007A;
    background: rgba(255, 0, 122, 0.08);
}

.news-link-btn.btn-ticket {
    border: 1px solid #7E57C2;
    color: #7E57C2;
    background: rgba(126, 87, 194, 0.08);
}

/* ==============================================================================
   Dynamic QR Code View (Fidèle à QRCodePage.xaml)
   ============================================================================== */

.qr-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
}

.qr-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px auto;
}

.qr-box {
    width: 250px;
    height: 250px;
    background: #FFFFFF;
    border: 2px solid var(--lkiz-cyan, #00B0FF);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-shadow: 0 8px 24px rgba(69, 39, 160, 0.25);
}

.qr-canvas {
    width: 100% !important;
    height: 100% !important;
    image-rendering: pixelated;
}

.qr-live-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(0, 230, 118, 0.15);
    border: 1px solid rgba(0, 230, 118, 0.4);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    color: var(--status-success);
    margin-bottom: 12px;
}

.qr-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--status-success);
    box-shadow: 0 0 10px var(--status-success);
    animation: blink 1.2s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.qr-user-id {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    margin-top: 10px;
    text-align: center;
    font-family: monospace;
}

.qr-timer {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    text-align: center;
}

.qr-fullscreen-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 14px;
    text-align: center;
}

/* ==============================================================================
   Subscriptions View (Abonnements & Cours)
   ============================================================================== */

.sub-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-left: 4px solid var(--lkiz-violet-light);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.sub-card-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    row-gap: 8px;
    align-items: center;
}

.sub-course-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.sub-plan-type {
    font-size: 13px;
    color: var(--text-secondary);
}

.sub-remaining {
    font-size: 18px;
    font-weight: 800;
    color: var(--lkiz-magenta);
}

.sub-remaining-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* ==============================================================================
   Settings & Profile View
   ============================================================================== */

.profile-header-card {
    background: linear-gradient(135deg, rgba(69, 39, 160, 0.4), rgba(255, 0, 122, 0.2));
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.profile-avatar-wrapper {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}

.profile-avatar {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--lkiz-violet), var(--lkiz-magenta));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    color: #FFFFFF;
    box-shadow: 0 4px 16px var(--lkiz-magenta-glow);
    overflow: hidden;
    position: relative;
}

.profile-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.profile-photo-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--lkiz-magenta);
    border: 2px solid #1A2035;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    transition: transform 0.15s ease, background 0.2s ease;
}

.profile-photo-badge:active {
    transform: scale(0.92);
}

.card-section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-link-danger {
    background: transparent;
    border: none;
    color: var(--status-danger);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    display: inline-block;
}

.btn-link-danger:hover {
    opacity: 0.8;
}

.profile-info {
    display: flex;
    flex-direction: column;
}

.profile-name {
    font-size: 18px;
    font-weight: 700;
}

.profile-email {
    font-size: 13px;
    color: var(--text-secondary);
}

.profile-role-tag {
    margin-top: 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--lkiz-magenta);
}

.settings-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.settings-item {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.settings-item:active {
    background: var(--bg-card-hover);
}

/* ==============================================================================
   Buttons & Inputs
   ============================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, var(--lkiz-violet), var(--lkiz-magenta));
    color: #FFFFFF;
    box-shadow: 0 4px 16px rgba(255, 0, 122, 0.35);
}

.btn-secondary {
    background: var(--surface-glass);
    color: var(--text-primary);
    border: 1px solid var(--border-glass);
}

.btn-danger {
    background: rgba(255, 61, 113, 0.15);
    color: var(--status-danger);
    border: 1px solid rgba(255, 61, 113, 0.4);
}

.btn-block {
    width: 100%;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 13px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    color: #FFFFFF;
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease;
}

.form-input:focus {
    border-color: var(--lkiz-magenta);
    box-shadow: 0 0 10px rgba(255, 0, 122, 0.3);
}

/* Réinitialisation stricte des contrôles natifs de mot de passe Webkit/IE */
input::-ms-reveal,
input::-ms-clear,
input::-webkit-credentials-auto-fill-button {
    display: none !important;
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.password-input-wrapper .form-input {
    padding-right: 48px;
    width: 100%;
}

.btn-toggle-password {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #A6A3C0;
    -webkit-appearance: none !important;
    appearance: none !important;
    z-index: 10;
}

.btn-toggle-password:active {
    transform: translateY(-50%) scale(0.92);
    color: var(--lkiz-magenta);
}

.eye-icon {
    width: 22px;
    height: 22px;
    fill: #A6A3C0;
    pointer-events: none;
    display: block;
}

.alert-success {
    background: rgba(0, 230, 118, 0.15);
    border: 1px solid rgba(0, 230, 118, 0.4);
    color: var(--status-success);
}

/* ==============================================================================
   Bottom Navigation Tab Bar (iOS Native Style)
   ============================================================================== */

.app-tabbar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--tabbar-height) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--chrome-background);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-top: 1px solid var(--border-glass);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
}

.tab-button {
    flex: 1;
    height: var(--tabbar-height);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s ease, transform 0.15s ease;
}

.tab-button:active {
    transform: scale(0.92);
}

.tab-button.active {
    color: var(--lkiz-magenta);
}

.tab-icon {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.tab-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: -0.2px;
}

/* ==============================================================================
   Authentication Screen & Dedicated Pages (Full Screen Multi-Page Flow)
   ============================================================================== */

.auth-screen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-base);
    z-index: 200;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: max(env(safe-area-inset-top), 24px) 16px max(env(safe-area-inset-bottom), 24px) 16px;
}

.auth-page-container {
    width: 100%;
    max-width: 440px;
    margin: auto 0;
    padding: 10px 0 30px 0;
}

.auth-page {
    display: none;
    animation: pageSlideUp 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.auth-page.active {
    display: block;
}

@keyframes pageSlideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-brand-block {
    text-align: center;
    margin-bottom: 24px;
}

.auth-logo {
    width: 128px;
    height: 128px;
    border-radius: 18px;
    margin: 0 auto 14px auto;
    display: block;
    box-shadow: none;
    border: none;
}

.auth-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 4px 0;
    letter-spacing: -0.5px;
}

.auth-subtitle {
    font-size: 14px;
    font-weight: 600;
    color: var(--lkiz-magenta);
    margin: 0 0 8px 0;
}

.auth-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0 auto;
    max-width: 320px;
}

.auth-form-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    padding: 22px 20px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
    margin-bottom: 18px;
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.btn-lg {
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 700;
}

/* Panneau de navigation vers Inscription & Reset */
.auth-navigation-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 8px 0 14px 0;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-divider span {
    padding: 0 12px;
}

.btn-outline-highlight {
    background: rgba(255, 0, 122, 0.08);
    color: #FFFFFF;
    border: 1.5px solid var(--lkiz-magenta);
    padding: 13px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(255, 0, 122, 0.2);
}

.btn-outline-highlight:active {
    background: rgba(255, 0, 122, 0.2);
    transform: scale(0.98);
}

.auth-secondary-links-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
    flex-wrap: wrap;
}

.btn-text-action {
    background: transparent;
    border: none;
    color: #A6A3C0;
    font-size: 13px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    padding: 6px 4px;
    transition: color 0.15s ease;
}

.btn-text-action:hover,
.btn-text-action:active {
    color: #FFFFFF;
}

/* En-tête avec bouton retour sur les pages secondaires */
.auth-nav-header {
    display: flex;
    align-items: center;
    margin-bottom: 18px;
    width: 100%;
}

.btn-back {
    background: var(--surface-glass);
    border: 1px solid var(--border-glass);
    color: #FFFFFF;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.btn-back:active {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(0.97);
}

.auth-footer-prompt {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
    color: var(--text-secondary);
    font-size: 13px;
}

.btn-inline-link {
    background: none;
    border: none;
    color: var(--lkiz-magenta);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

/* ==============================================================================
   Feedback & Loading States
   ============================================================================== */

.loader-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 0, 122, 0.2);
    border-top-color: var(--lkiz-magenta);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 30px auto;
}

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

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-state-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.alert-box {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 14px;
}

.alert-danger {
    background: rgba(255, 61, 113, 0.15);
    border: 1px solid rgba(255, 61, 113, 0.4);
    color: var(--status-danger);
}

/* ==============================================================================
   À Propos de l'école (Fidèle à AboutPage.xaml)
   ============================================================================== */

.about-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
    padding-top: 8px;
}

.about-logo-wrapper {
    width: 128px;
    height: 128px;
    border-radius: 50%;
    border: 3px solid var(--lkiz-violet, #4527A0);
    box-shadow: 0 4px 14px rgba(69, 39, 160, 0.35);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.about-logo-img {
    width: 128px;
    height: 128px;
    object-fit: cover;
    border-radius: 50%;
}

.about-school-name {
    font-size: 20px;
    font-weight: 700;
    margin-top: 12px;
    color: var(--text-primary);
    text-align: center;
}

.about-description {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
    word-break: break-word;
}

.about-section {
    margin-top: 22px;
}

.about-section-divider {
    height: 1px;
    background: var(--border-glass);
    margin-bottom: 14px;
}

.about-section-title {
    font-size: 19px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.about-team-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.about-team-card {
    border: 1px solid var(--border-glass);
    border-radius: 14px;
    background: var(--bg-card);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.about-team-avatar-wrap {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 1.5px solid var(--lkiz-violet, #4527A0);
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-team-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.about-team-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.about-team-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.about-team-role {
    font-size: 13px;
    color: var(--lkiz-cyan, #00B0FF);
    line-height: 1.3;
    word-break: break-word;
}

.about-link-card {
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    background: var(--bg-card);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    margin-bottom: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.about-link-card:active {
    transform: scale(0.98);
}

.about-link-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.about-link-text {
    font-size: 14px;
    font-weight: 700;
    color: var(--lkiz-cyan, #00B0FF);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.about-social-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px;
}

.about-social-btn {
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.2s ease;
    display: block;
}

.about-social-btn.btn-insta {
    border: 1px solid var(--lkiz-magenta);
    color: var(--lkiz-magenta);
    background: rgba(255, 0, 122, 0.08);
}

.about-social-btn.btn-fb {
    border: 1px solid #1E88E5;
    color: #1E88E5;
    background: rgba(30, 136, 229, 0.08);
}

.about-social-btn:active {
    transform: scale(0.97);
}

.about-legal-card {
    width: 100%;
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    background: var(--bg-card);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.about-legal-card:hover, .about-legal-card:active {
    border-color: var(--lkiz-violet);
    transform: scale(0.99);
}

.about-legal-icon {
    font-size: 17px;
    margin-right: 10px;
}

.about-legal-label {
    flex: 1;
    text-align: left;
}

.about-legal-arrow {
    font-size: 22px;
    color: var(--text-muted);
}

.about-footer {
    text-align: center;
    margin-top: 26px;
    padding-bottom: 16px;
    color: var(--text-muted);
    font-size: 12px;
}

.about-copyright {
    margin-bottom: 6px;
    line-height: 1.4;
}

.about-app-version {
    font-size: 11px;
    color: var(--text-muted);
}

/* ==============================================================================
   Modal Légale (CGU / Confidentialité)
   ============================================================================== */

.lkiz-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeIn 0.2s ease;
}

.lkiz-modal-sheet {
    background: #1A2035;
    border: 1px solid var(--border-glass);
    border-radius: 18px;
    max-height: 82vh;
    width: 100%;
    max-width: 580px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
    overflow: hidden;
}

.lkiz-modal-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-glass);
}

.lkiz-modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.lkiz-modal-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #FFFFFF;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    transition: background 0.2s ease;
}

.lkiz-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lkiz-modal-body {
    padding: 20px;
    overflow-y: auto;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--text-secondary);
    white-space: pre-wrap;
    -webkit-overflow-scrolling: touch;
}

/* Language selection stays available before sign-in and in profile settings. */
.news-vote { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.news-vote-button { flex: 1 1 120px; min-height: 44px; border: 1px solid var(--border-glass); color: var(--text-primary); background: var(--surface-glass); }
.news-vote-button[aria-pressed="true"] { border-color: var(--lkiz-magenta); color: var(--lkiz-magenta); background: var(--bg-card); }
.news-vote p { flex-basis: 100%; margin: 0; }
.messaging-header-actions { display: flex; align-items: center; gap: 2px; }
.messaging-header-actions[hidden] { display: none; }
.settings-header-actions { display: flex; align-items: center; gap: 4px; }
.settings-header-actions[hidden] { display: none; }
.password-settings { margin-bottom: 20px; }
.password-settings > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; list-style: none; cursor: pointer; }
.password-settings > summary::-webkit-details-marker { display: none; }
.password-settings > summary svg { width: 22px; height: 22px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .2s; }
.password-settings[open] > summary svg { transform: rotate(180deg); }
.password-settings > summary:focus-visible { outline: 2px solid var(--lkiz-magenta); outline-offset: 3px; }
.password-settings > form { margin-top: 14px; padding: 20px; border: 1px solid var(--border-glass); border-radius: var(--radius-md); background: var(--bg-card); }
.header-preference-control { position: relative; display: grid; place-items: center; width: 44px; height: 44px; flex-shrink: 0; border: 1px solid var(--border-glass); border-radius: 50%; background: var(--surface-glass); color: var(--text-primary); }
.header-preference-control select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.header-preference-control:focus-within { outline: 2px solid var(--lkiz-magenta); outline-offset: 3px; }
.header-theme-icon { display: none; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
html[data-theme-mode="light"] [data-theme-icon="light"],
html[data-theme-mode="dark"] [data-theme-icon="dark"],
html[data-theme-mode="system"] [data-theme-icon="system"] { display: block; }
.messaging-header-actions .header-icon-button { border-radius: 50%; }
.messaging-header-actions button:disabled { opacity: .45; cursor: progress; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
#messagingStatus:empty { display: none; }
#messagingStatus { padding: 12px 16px; border-radius: 14px; background: var(--bg-card); color: var(--text-secondary); overflow-wrap: anywhere; }
.message-contact-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 20px; margin-bottom: 24px; border: 1px solid var(--border-glass); border-radius: 20px; background: var(--bg-card); }
.message-contact-form label { grid-column: 1 / -1; font-weight: 600; }
.message-contact-form .form-input { min-width: 0; }
.message-thread { display: flex; align-items: center; gap: 14px; text-align: left; width: 100%; padding: 18px; margin-bottom: 10px; border: 1px solid var(--border-glass); border-radius: 18px; background: var(--bg-card); color: var(--text-primary); font: inherit; cursor: pointer; transition: border-color .18s, background .18s; }
.message-thread:hover { border-color: var(--lkiz-magenta); background: var(--surface-glass); }
.message-thread:focus-visible { outline: 2px solid var(--lkiz-magenta); outline-offset: 3px; }
.message-avatar { display: grid; place-items: center; flex: 0 0 46px; height: 46px; border-radius: 16px; background: linear-gradient(135deg, var(--lkiz-violet), var(--lkiz-magenta)); color: white; font-weight: 700; font-size: 16px; }
.message-thread-preview { display: grid; gap: 6px; min-width: 0; flex: 1; }
.message-thread-preview strong, .message-thread-preview > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-thread-preview > span { color: var(--text-secondary); font-size: 13px; }
.message-conversation-heading { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--border-glass); }
.message-conversation-heading h2 { min-width: 0; margin: 0; overflow-wrap: anywhere; font-size: 18px; }
#messageHistory { display: flex; flex-direction: column; gap: 14px; min-height: 28dvh; max-height: 50dvh; overflow-y: auto; overscroll-behavior: contain; padding: 24px 4px; }
.message-bubble { align-self: flex-start; max-width: 86%; padding: 14px 18px; background: var(--bg-card); border: 1px solid var(--border-glass); border-radius: 20px 20px 20px 5px; overflow-wrap: anywhere; }
.message-bubble.mine { align-self: flex-end; background: linear-gradient(135deg, #4527a0, #7933a8); border-color: transparent; border-radius: 20px 20px 5px 20px; color: white; }
.message-bubble p { white-space: pre-wrap; margin: 0 0 8px; line-height: 1.55; }
.message-bubble small { color: var(--text-secondary); font-size: 11px; }
.message-bubble.mine small { color: #eee6fa; }
#messageForm { position: sticky; bottom: 0; display: flex; align-items: flex-end; gap: 10px; padding: 12px; margin: 0; border: 1px solid var(--border-glass); border-radius: 22px; background: var(--bg-card); }
#messageBody { flex: 1; min-width: 0; min-height: 48px; max-height: 160px; resize: vertical; border: 0; background: transparent; }
#btnSendMessage { flex-shrink: 0; min-height: 48px; border-radius: 15px; }
@media (max-width: 420px) {
 .message-contact-form { padding: 16px; }
 #messageForm { flex-wrap: wrap; }
 #messageBody { flex-basis: 100%; }
 #btnSendMessage { margin-left: auto; }
 .message-bubble { max-width: 92%; }
 .messaging-header-actions .header-icon-button { width: 40px; min-width: 40px; }
}
.auth-language-picker {
    position: relative;
    width: 44px;
    height: 44px;
    margin-bottom: 20px;
    border-radius: 8px;
}
.auth-language-flag { display: flex; align-items: center; justify-content: center; height: 100%; }
.auth-language-flag svg { display: none; width: 30px; height: 20px; }
html[lang="fr"] [data-flag="fr"],
html[lang="pt"] [data-flag="pt"],
html[lang="de"] [data-flag="de"],
html[lang="en"] [data-flag="en"] { display: block; }
.auth-language-picker select {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}
.auth-language-picker:focus-within { outline: 2px solid var(--lkiz-violet-light); outline-offset: 3px; }
.language-picker {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 20px;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 14px;
}
.language-picker select {
    min-height: 44px;
    max-width: 100%;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-accent);
    background: var(--bg-dark);
    color: var(--text-primary);
    font: inherit;
    cursor: pointer;
    color-scheme: inherit;
}
.language-picker select:focus-visible {
    outline: 2px solid var(--lkiz-violet-light);
    outline-offset: 3px;
}

/* Client navigation and theme variants. */
.app-header { gap: 10px; }
.app-brand { flex: 1; min-width: 0; }
.app-brand-text { min-width: 0; }
.app-brand-title { overflow-wrap: anywhere; }
.header-icon-button {
 display: inline-flex; align-items: center; justify-content: center;
 width: 44px; height: 44px; flex-shrink: 0; border-radius: var(--radius-sm);
 background: var(--surface-glass); border: 1px solid var(--border-glass);
 color: var(--text-primary); cursor: pointer; font-size: 26px;
}
.header-icon-button svg { width: 24px; height: 24px; fill: currentColor; }
.app-menu {
 margin: auto; width: min(90vw, 400px); padding: 20px;
 max-height: 85dvh; overflow-y: auto; border: 1px solid var(--border-glass);
 border-radius: var(--radius-lg); background: var(--bg-card); color: var(--text-primary);
 box-shadow: 0 16px 50px rgba(0,0,0,.3);
}
.app-menu::backdrop { background: rgba(10, 5, 20, .65); }
.app-menu-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.app-menu nav { display: grid; gap: 10px; }
.menu-item {
 display: flex; align-items: center; gap: 12px; text-align: left; min-height: 48px;
 padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border-glass);
 background: var(--surface-glass); color: var(--text-primary); font: inherit; cursor: pointer;
}
.menu-item.active { color: var(--lkiz-magenta); border-color: var(--lkiz-magenta); }
.menu-item .tab-label { font-size: inherit; }
.secondary-page .app-tabbar { display: none; }
.secondary-page .ios-install-banner { display: none; }
.secondary-page .app-content { padding-bottom: max(env(safe-area-inset-bottom), 24px); }
[data-theme="light"] .app-brand-title { background: none; -webkit-text-fill-color: var(--text-primary); color: var(--text-primary); }
[data-theme="light"] .header-status-badge,
[data-theme="light"] .badge-violet { color: var(--lkiz-violet); background: #EEE7FA; }
[data-theme="light"] .form-input,
[data-theme="light"] .btn-outline-highlight,
[data-theme="light"] .btn-back,
[data-theme="light"] .btn-text-action:hover,
[data-theme="light"] .btn-text-action:active,
[data-theme="light"] .lkiz-modal-close { color: var(--text-primary); }
[data-theme="light"] .form-input { background: #FFFFFF; }
[data-theme="light"] .btn-text-action,
[data-theme="light"] .form-input::placeholder { color: var(--text-secondary); }
[data-theme="light"] .eye-icon { fill: var(--text-secondary); }
[data-theme="light"] .auth-divider::before,
[data-theme="light"] .auth-divider::after { border-color: var(--border-glass); }
[data-theme="light"] .lkiz-modal-sheet { background: var(--bg-card); }
[data-theme="light"] .btn-fb { color: #1263A6; }
[data-theme="light"] .btn-insta { color: var(--lkiz-magenta); }
[data-theme="light"] .btn-ticket { color: #593394; }
[data-theme="light"] .app-container { box-shadow: 0 0 45px rgba(69,39,160,.08); }
@media (max-width: 420px) {
 .app-header { padding-left: 12px; padding-right: 12px; gap: 8px; }
 .app-header .header-status-badge { display: none; }
 .secondary-page .app-brand-logo { display: none; }
}
@media (min-width: 900px) { .app-container { max-width: 880px; } }
@media (prefers-reduced-motion: reduce) {
 *, *::before, *::after { animation: none !important; transition: none !important; }
}
