/* =====================================================================
   Techage design system — shared components (used by LessonDock)
   Colours come only from theme tokens (see css/theme.css and themes.css).
   ===================================================================== */

html { -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font-family);
    font-size: calc(0.9375rem * var(--font-scale, 1));
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5, h6 { font-weight: 700; letter-spacing: -.01em; color: var(--text-color); }
a { text-decoration: none; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid rgba(var(--accent-rgb), .7); outline-offset: 2px; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 2000; background: var(--accent-color); color: var(--on-accent); padding: 8px 14px; border-radius: 8px; font-weight: 700; }
.skip-link:focus { left: 8px; }
.visually-hidden-focusable:not(:focus):not(:focus-within) { position: absolute !important; }
.fw-800 { font-weight: 800; }
.min-w-0 { min-width: 0; }

/* ---------- Brand mark ---------- */
.brand { display: inline-flex; align-items: center; gap: .7rem; color: inherit; min-width: 0; }
.brand-logo { width: 52px; height: 52px; border-radius: 50%; object-fit: contain; flex-shrink: 0; background: #fff; }
.brand-mark {
    width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
    background: var(--primary-color); color: var(--accent-color); font-size: 1.35rem;
    box-shadow: inset 0 0 0 3px var(--surface-color), 0 0 0 2px var(--accent-color);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.brand-text strong { font-size: 1.55rem; font-weight: 800; letter-spacing: .01em; }
.brand-text span { font-size: 1.02rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Status badges & pills ---------- */
.badge-status {
    display: inline-flex; align-items: center; gap: .3rem; padding: .22rem .6rem; border-radius: 999px;
    font-size: .74rem; font-weight: 600; line-height: 1.3; white-space: nowrap;
}
.badge-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge-success { background: rgba(var(--success-rgb), .12); color: var(--success-color); }
.badge-warning { background: rgba(var(--warning-rgb), .14); color: var(--warning-color); }
.badge-danger { background: rgba(var(--danger-rgb), .12); color: var(--danger-color); }
.badge-info { background: var(--primary-soft); color: var(--primary-color); }
.badge-neutral { background: var(--surface-alt); color: var(--muted-color); }
:root[data-theme="dark"] .badge-info { color: var(--text-color); }
.pill {
    display: inline-block; padding: .18rem .65rem; border-radius: 999px; font-size: .75rem; font-weight: 600;
    background: var(--primary-soft); color: var(--primary-color); white-space: nowrap;
}
.pill-accent { background: var(--accent-soft); color: var(--accent-strong); }
.pill-muted { background: var(--surface-alt); color: var(--muted-color); }
:root[data-theme="dark"] .pill { color: var(--text-color); }

/* ---------- Cards / panels ---------- */
.panel {
    background: var(--surface-color); border: 1px solid var(--border-color); border-radius: var(--border-radius);
    box-shadow: 0 1px 2px var(--shadow-color), 0 6px 18px var(--shadow-color);
}
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: 1rem 1.25rem .75rem; flex-wrap: wrap; }
.panel-title { display: flex; align-items: center; gap: .6rem; font-size: 1.05rem; font-weight: 700; margin: 0; }
.panel-title > i { color: var(--primary-color); font-size: 1.1rem; }
.panel-title small { display: block; font-size: .8rem; font-weight: 400; color: var(--muted-color); margin-top: 2px; }
.panel-body { padding: .5rem 1.25rem 1.25rem; }
.panel-footer { padding: .75rem 1.25rem; border-top: 1px solid var(--border-color); }
.panel-link { font-size: .82rem; font-weight: 600; color: var(--primary-color); white-space: nowrap; }
:root[data-theme="dark"] .panel-link, :root[data-theme="dark"] .panel-title > i { color: var(--accent-color); }

.icon-circle {
    width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
    background: var(--primary-color); color: #fff; font-size: 1.2rem;
}
.icon-circle.accent { background: var(--accent-color); color: var(--on-accent); }
.icon-circle.success { background: var(--success-color); }
.icon-circle.danger { background: var(--danger-color); }
.icon-circle.warning { background: var(--warning-color); }
.icon-circle.info { background: color-mix(in srgb, var(--primary-color) 55%, #0EA5E9); }
.icon-circle.violet { background: color-mix(in srgb, var(--primary-color) 45%, #9333EA); }
.icon-circle.sm { width: 36px; height: 36px; font-size: .95rem; }
.icon-circle.lg { width: 64px; height: 64px; font-size: 1.55rem; }

/* Date block (Important Dates / Upcoming Events) */
.date-block {
    width: 54px; flex-shrink: 0; border-radius: 8px; background: var(--chrome-bg); color: #fff; text-align: center;
    padding: .35rem .2rem; line-height: 1.05; font-weight: 700;
}
.date-block .d { font-size: 1.25rem; display: block; }
.date-block .m { font-size: .68rem; text-transform: uppercase; display: block; letter-spacing: .04em; }
.date-block .y { font-size: .62rem; font-weight: 500; opacity: .85; display: block; }

/* Empty state */
.empty-state { text-align: center; padding: 2.25rem 1rem; color: var(--muted-color); }
.empty-state i { font-size: 2rem; color: var(--border-color); display: block; margin-bottom: .6rem; }
.empty-state strong { display: block; color: var(--text-color); margin-bottom: .2rem; }

/* Forms */
.form-label { font-weight: 600; font-size: .86rem; margin-bottom: .3rem; }
.form-label .req { color: var(--danger-color); }
.form-control, .form-select { min-height: 44px; }
textarea.form-control { min-height: 90px; }
.form-section { padding: 1.25rem; border: 1px solid var(--border-color); border-radius: var(--border-radius); background: var(--surface-color); margin-bottom: 1rem; }
.form-section-title { font-size: .95rem; font-weight: 700; margin-bottom: .9rem; display: flex; align-items: center; gap: .5rem; }
.form-section-title i { color: var(--accent-color); }
@media (pointer: coarse) { .form-control, .form-select, .btn { min-height: 44px; } }
@media (max-width: 575.98px) { .form-control, .form-select { font-size: 16px; } }

/* Loading states */
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
    content: ""; position: absolute; inset: 0; margin: auto; width: 1.1rem; height: 1.1rem; border-radius: 50%;
    border: 2px solid currentColor; border-color: var(--on-primary) transparent var(--on-primary) transparent; animation: spin .7s linear infinite;
}
.btn-accent.is-loading::after, .btn-light.is-loading::after { border-color: var(--text-color) transparent var(--text-color) transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.page-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--accent-color); z-index: 3000; transition: width .3s ease; }
.page-progress.active { width: 70%; transition: width 8s cubic-bezier(.1, .7, .1, 1); }
.skeleton { background: linear-gradient(90deg, var(--surface-alt) 25%, var(--border-color) 50%, var(--surface-alt) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 6px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Tables */
.table-modern { margin: 0; font-size: .875rem; }
.table-modern thead th {
    font-size: .74rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted-color); font-weight: 700;
    background: var(--surface-alt); border-bottom: 1px solid var(--border-color); padding: .7rem .85rem; white-space: nowrap;
}
.table-modern td { padding: .75rem .85rem; vertical-align: middle; border-color: var(--border-color); }
.table-modern tbody tr:last-child td { border-bottom: 0; }
.table-responsive { border-radius: var(--border-radius); }
.cell-main { font-weight: 600; color: var(--text-color); }
.cell-sub { font-size: .78rem; color: var(--muted-color); }
@media (max-width: 767.98px) {
    /* Tables marked .table-stack become cards on phones. */
    .table-stack thead { display: none; }
    .table-stack, .table-stack tbody, .table-stack tr, .table-stack td { display: block; width: 100%; }
    .table-stack tr { border: 1px solid var(--border-color); border-radius: var(--border-radius); margin: 0 0 .75rem; padding: .35rem .25rem; background: var(--surface-color); }
    .table-stack td { border: 0 !important; padding: .35rem .75rem; display: flex; justify-content: space-between; gap: 1rem; text-align: right; }
    .table-stack td::before { content: attr(data-label); font-weight: 600; color: var(--muted-color); font-size: .78rem; text-align: left; flex-shrink: 0; }
    .table-stack td[data-label=""]::before { content: none; }
}

/* Pager */
.pager { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; padding: .85rem 1.25rem; }
.pager-info { font-size: .82rem; color: var(--muted-color); }

/* Representation banner (used in dashboard, exam, results) */
.representation-card {
    border-radius: var(--border-radius); background: var(--chrome-bg); color: #fff; padding: 1.1rem 1.25rem;
    border-left: 6px solid var(--accent-color); position: relative; overflow: hidden;
}
.representation-card .rep-label { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-color); font-weight: 800; }
.representation-card .rep-name { font-size: 1.3rem; font-weight: 800; line-height: 1.2; margin: .15rem 0 .5rem; color: #fff; }
.representation-card .rep-meta { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; font-size: .82rem; color: rgba(255,255,255,.82); }
.representation-card .rep-meta b { color: #fff; font-weight: 600; }

/* =====================================================================
   PUBLIC SITE
   ===================================================================== */
.site-header { background: var(--surface-color); border-bottom: 1px solid var(--border-color); position: sticky; top: 0; z-index: 1030; box-shadow: 0 2px 10px var(--shadow-color); }
.site-header .navbar { padding: .6rem 0; }
.site-header .container { max-width: 1500px; }
.site-header .navbar-brand { margin-right: 1rem; padding: 0; flex-shrink: 0; }
.site-header .brand-text strong { color: var(--primary-color); }
.site-header .brand-text span { color: var(--text-color); overflow: visible; }
:root[data-theme="dark"] .site-header .brand-text strong { color: var(--text-color); }
.site-nav .nav-link { color: var(--text-color); font-weight: 500; font-size: .9rem; padding: .5rem .7rem !important; border-radius: 6px; white-space: nowrap; }
.site-nav .nav-link:hover { color: var(--primary-color); }
.site-nav .nav-link.active { background: var(--accent-color); color: var(--on-accent); font-weight: 600; }
.site-actions { display: flex; flex-wrap: nowrap; gap: .5rem; }
.site-actions .btn { white-space: nowrap; font-size: .88rem; padding: .5rem 1rem; }
@media (max-width: 1399.98px) {
    /* Collapsed menu: links stack, buttons share one row. */
    .site-nav { padding: .5rem 0; }
    .site-nav .nav-link { padding: .65rem .85rem !important; }
    .site-actions { padding-bottom: .75rem; }
    .site-actions .btn { flex: 1; }
}
@media (max-width: 400px) { .site-header .brand-text span { font-size: .9rem; } .site-header .brand-text strong { font-size: 1.3rem; } }
.btn-login { border: 2px solid var(--primary-color); color: var(--primary-color); font-weight: 600; }
.btn-login:hover { background: var(--primary-color); color: var(--on-primary); }
:root[data-theme="dark"] .btn-login { border-color: var(--text-color); color: var(--text-color); }
.navbar-toggler { border-color: var(--border-color); }
.navbar-toggler:focus { box-shadow: 0 0 0 .2rem rgba(var(--primary-rgb), .2); }
.navbar-toggler-icon { background-image: none; display: grid; place-items: center; }
.navbar-toggler-icon::before { content: "\f0c9"; font-family: "Font Awesome 6 Free"; font-weight: 900; color: var(--text-color); font-size: 1.2rem; }

.info-strip { background: var(--chrome-bg); color: #fff; font-size: .84rem; }
.info-strip .container { display: flex; align-items: center; gap: 1.25rem; min-height: 42px; }
.strip-track { flex: 1; min-width: 0; overflow: hidden; }
.strip-items { display: flex; align-items: center; gap: 1.25rem; white-space: nowrap; width: max-content; padding: .45rem 0; }
.info-strip .item { display: inline-flex; align-items: center; gap: .5rem; font-weight: 500; }
.info-strip .item > i { opacity: .9; }
.info-strip .item a { color: #fff; }
.info-strip .item a:hover { color: var(--accent-color); }
.info-strip .item.notice > i { color: var(--accent-color); }
.info-strip .item.notice > span { font-weight: 600; }
.info-strip .strip-cta { background: var(--accent-color); color: var(--on-accent) !important; border-radius: 999px; padding: .12rem .7rem; font-weight: 700; font-size: .76rem; margin-left: .25rem; }
.info-strip .strip-cta:hover { filter: brightness(1.05); }
.info-strip .sep { width: 1px; height: 18px; background: rgba(255,255,255,.35); flex-shrink: 0; }
.info-strip .tagline { margin-left: auto; font-style: italic; font-family: Georgia, "Times New Roman", serif; opacity: .95; white-space: nowrap; flex-shrink: 0; }
/* When the items do not fit (phones), they scroll as a ticker; paused on hover/focus and for reduced motion. */
.strip-track.is-ticker .strip-items { animation: stripTicker var(--ticker-duration, 30s) linear infinite; }
.strip-track.is-ticker:hover .strip-items, .strip-track.is-ticker:focus-within .strip-items { animation-play-state: paused; }
@keyframes stripTicker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .strip-track.is-ticker { overflow-x: auto; } .strip-track.is-ticker .strip-items { animation: none; } }
@media (max-width: 991.98px) { .info-strip .tagline { display: none; } }
/* Hero */
.hero {
    position: relative; color: #fff; overflow: hidden; min-height: 340px;
    background:
        radial-gradient(1200px 500px at 85% 20%, rgba(var(--accent-rgb), .18), transparent 60%),
        linear-gradient(110deg, var(--chrome-bg) 0%, var(--primary-color) 55%, var(--chrome-bg-2) 100%);
}
.hero.has-image { background-size: cover; background-position: center right; }
.hero::before {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(90deg, rgba(var(--primary-rgb), .96) 0%, rgba(var(--primary-rgb), .82) 38%, rgba(var(--primary-rgb), .15) 70%, rgba(var(--primary-rgb), 0) 100%);
}
.hero:not(.has-image)::before { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cpath fill='%23ffffff' fill-opacity='0.04' d='M38 0h4v80h-4zM0 38h80v4H0z'/%3E%3C/svg%3E"); }
.hero .container { position: relative; z-index: 1; padding-top: 2.6rem; padding-bottom: 2.6rem; }
.hero-badge { display: inline-block; background: var(--accent-color); color: var(--on-accent); font-weight: 700; font-size: .76rem; letter-spacing: .04em; padding: .35rem .8rem; border-radius: 6px; text-transform: uppercase; }
.hero-title { font-size: clamp(2.1rem, 5.4vw, 3.6rem); font-weight: 800; line-height: 1.02; margin: 1rem 0 .6rem; color: #fff; letter-spacing: -.02em; }
.hero-title .accent { color: var(--accent-color); display: block; }
.hero-lead { font-size: clamp(1.05rem, 2vw, 1.4rem); font-weight: 500; margin-bottom: 1rem; color: #fff; }
.hero-text { max-width: 560px; color: rgba(255,255,255,.9); font-size: .98rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.4rem; }
.hero-actions .btn { padding: .7rem 1.4rem; }
.btn-outline-light-strong { border: 2px solid rgba(255,255,255,.85); color: #fff; font-weight: 600; }
.btn-outline-light-strong:hover { background: #fff; color: var(--primary-color); }
.hero-status { display: inline-flex; align-items: center; gap: .45rem; margin-top: 1rem; font-size: .85rem; background: rgba(255,255,255,.12); padding: .35rem .8rem; border-radius: 999px; }
.hero-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success-color); box-shadow: 0 0 0 3px rgba(var(--success-rgb), .3); }
.hero-status.closed .dot { background: var(--warning-color); box-shadow: 0 0 0 3px rgba(var(--warning-rgb), .3); }
.hero-verse {
    background: rgba(var(--primary-rgb), .78); border-left: 4px solid var(--accent-color); padding: 1.3rem 1.4rem; border-radius: 10px;
    max-width: 320px; margin-left: auto; font-family: Georgia, "Times New Roman", serif; backdrop-filter: blur(2px);
}
.hero-verse p { font-size: 1.2rem; line-height: 1.4; margin: 0 0 .5rem; color: #fff; }
.hero-verse p::before { content: "\201C"; color: var(--accent-color); font-size: 2.2rem; line-height: 0; vertical-align: -.45rem; margin-right: .15rem; }
.hero-verse cite { color: var(--accent-color); font-style: normal; font-size: .85rem; font-family: var(--font-family); font-weight: 600; }

/* Feature strip */
.feature-strip { margin-top: -1.6rem; position: relative; z-index: 2; }
.feature-strip .panel { padding: 1.1rem .5rem; }
.feature { display: flex; gap: .9rem; align-items: flex-start; padding: .4rem 1rem; }
.feature h3 { font-size: .98rem; margin: .15rem 0 .25rem; }
.feature p { font-size: .8rem; color: var(--muted-color); margin: 0; }
@media (min-width: 992px) { .feature-col + .feature-col { border-left: 1px solid var(--border-color); } }

.section { padding: 2.25rem 0; }
.section-title { font-size: 1.3rem; font-weight: 800; margin: 0 0 1rem; position: relative; padding-top: .6rem; }
.section-title::before { content: ""; position: absolute; top: 0; left: 0; width: 34px; height: 4px; border-radius: 4px; background: var(--accent-color); }
.section-title.center { text-align: center; }
.section-title.center::before { left: 50%; transform: translateX(-50%); }

.about-media { border-radius: var(--border-radius); overflow: hidden; min-height: 170px; height: 100%; position: relative;
    background: linear-gradient(135deg, var(--primary-color), var(--chrome-bg)); display: grid; place-items: center; color: var(--accent-color); font-size: 4rem; }
.about-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.about-media::after { content: ""; position: absolute; right: -30px; bottom: -30px; width: 130px; height: 130px; background: var(--accent-color); opacity: .85; transform: rotate(35deg); border-radius: 12px; }

/* Competition structure */
.structure-grid { display: grid; grid-template-columns: repeat(3, 1fr); row-gap: 1.1rem; position: relative; }
.structure-step { text-align: center; position: relative; }
.structure-step .icon-circle { margin: 0 auto .45rem; width: 64px; height: 64px; font-size: 1.5rem; box-shadow: 0 6px 14px rgba(var(--primary-rgb), .25); }
.structure-step > span:last-child { font-size: .84rem; font-weight: 600; color: var(--primary-color); }
:root[data-theme="dark"] .structure-step span { color: var(--text-color); }
.structure-step:not(:nth-child(3n))::after { content: "\f061"; font-family: "Font Awesome 6 Free"; font-weight: 900; position: absolute; right: -10px; top: 22px; color: var(--primary-color); font-size: 1.1rem; }
:root[data-theme="dark"] .structure-step:not(:nth-child(3n))::after { color: var(--muted-color); }
.structure-step.final .icon-circle { background: var(--accent-color); color: var(--on-accent); }

/* Important dates / announcements lists */
.date-list { display: flex; flex-direction: column; gap: .55rem; }
.date-item { display: flex; gap: .8rem; align-items: center; padding: .45rem; border-radius: 10px; background: var(--surface-alt); color: var(--text-color); }
.date-item:hover { color: var(--text-color); }
.date-item h4 { font-size: .86rem; margin: 0; font-weight: 700; }
.date-item p { font-size: .76rem; margin: .1rem 0 0; color: var(--muted-color); }
.date-item .chev { margin-left: auto; color: var(--muted-color); padding-right: .4rem; }

/* Top performers */
.performer { text-align: center; padding: 1rem .5rem; border: 1px solid var(--border-color); border-radius: 10px; background: var(--surface-color); height: 100%; }
.medal { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto .5rem; font-weight: 800; color: #fff; box-shadow: inset 0 0 0 3px rgba(255,255,255,.55); }
.medal-1 { background: linear-gradient(135deg, #FACC15, #D97706); }
.medal-2 { background: linear-gradient(135deg, #CBD5E1, #64748B); }
.medal-3 { background: linear-gradient(135deg, #FDBA74, #C2410C); }
.performer .name { font-weight: 700; font-size: .92rem; }
.performer .unit { font-size: .78rem; color: var(--muted-color); }
.performer .pct { font-weight: 800; margin-top: .35rem; color: var(--primary-color); }
:root[data-theme="dark"] .performer .pct { color: var(--accent-color); }

/* CTA */
.cta-card {
    border-radius: var(--border-radius); padding: 1.6rem; color: #fff; position: relative; overflow: hidden; height: 100%;
    background: linear-gradient(120deg, var(--chrome-bg) 0%, var(--primary-color) 100%);
}
.cta-card h3 { color: #fff; font-size: 1.45rem; font-weight: 800; line-height: 1.15; }
.cta-card h3 span { color: var(--accent-color); }
.cta-card p { color: rgba(255,255,255,.88); font-size: .92rem; }
.cta-card::after { content: "\f5da"; font-family: "Font Awesome 6 Free"; font-weight: 900; position: absolute; right: -10px; bottom: -24px; font-size: 7.5rem; color: rgba(255,255,255,.07); transform: rotate(-12deg); }

/* Generic public page */
.page-hero { background: linear-gradient(110deg, var(--chrome-bg), var(--primary-color)); color: #fff; padding: 2.4rem 0 2.2rem; }
.page-hero h1 { color: #fff; font-size: clamp(1.6rem, 4vw, 2.3rem); font-weight: 800; margin: 0; }
.page-hero p { color: rgba(255,255,255,.85); margin: .4rem 0 0; }
.page-hero .breadcrumb { --bs-breadcrumb-divider-color: rgba(255,255,255,.6); --bs-breadcrumb-item-active-color: rgba(255,255,255,.85); margin-bottom: .5rem; font-size: .82rem; }
.page-hero .breadcrumb a { color: var(--accent-color); }
.prose { font-size: 1rem; line-height: 1.75; }
.prose p { margin-bottom: 1rem; }

/* Footer */
.site-footer { background: var(--chrome-bg); color: rgba(255,255,255,.85); font-size: .85rem; margin-top: 2rem; }
.site-footer .container { padding-top: 1.1rem; padding-bottom: 1.1rem; }
.site-footer a { color: rgba(255,255,255,.85); }
.site-footer a:hover { color: var(--accent-color); }
.site-footer .brand-mark, .site-footer .brand-logo { width: 44px; height: 44px; font-size: 1.1rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: .25rem 0; list-style: none; margin: 0; padding: 0; }
.footer-links li + li::before { content: "|"; opacity: .35; margin: 0 .7rem; }
.footer-social a { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; background: rgba(255,255,255,.1); margin-left: .35rem; }
.footer-social a:hover { background: var(--accent-color); color: var(--on-accent); }
.footer-copy { font-size: .74rem; text-align: right; color: rgba(255,255,255,.7); }
@media (max-width: 991.98px) { .footer-copy { text-align: center; } }

/* Leaderboard medal rows */
.rank-badge { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 800; font-size: .8rem; background: var(--surface-alt); color: var(--text-color); }
.rank-badge.r1 { background: linear-gradient(135deg, #FACC15, #D97706); color: #fff; }
.rank-badge.r2 { background: linear-gradient(135deg, #CBD5E1, #64748B); color: #fff; }
.rank-badge.r3 { background: linear-gradient(135deg, #FDBA74, #C2410C); color: #fff; }

/* =====================================================================
   AUTH PAGES
   ===================================================================== */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr; background: var(--background-color); }
@media (min-width: 992px) { .auth-wrap { grid-template-columns: 1.05fr 1fr; } }
.auth-side {
    display: none; position: relative; color: #fff; padding: 3rem; overflow: hidden;
    background: linear-gradient(135deg, var(--chrome-bg) 0%, var(--primary-color) 100%);
    background-size: cover; background-position: center;
}
.auth-side.has-image::before { content: ""; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(var(--primary-rgb), .92), rgba(var(--primary-rgb), .55)); }
.auth-side > * { position: relative; }
@media (min-width: 992px) { .auth-side { display: flex; flex-direction: column; justify-content: space-between; } }
.auth-side h2 { color: #fff; font-size: 2.2rem; font-weight: 800; line-height: 1.1; }
.auth-side h2 span { color: var(--accent-color); }
.auth-side .brand-text strong, .auth-side .brand-text span { color: #fff; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card.wide { max-width: 720px; }
.auth-card .panel { padding: 1.75rem; }
@media (max-width: 575.98px) { .auth-card .panel { padding: 1.25rem; } }
.auth-card h1 { font-size: 1.5rem; margin-bottom: .25rem; }
.auth-mobile-brand { display: flex; justify-content: center; margin-bottom: 1.25rem; }
.auth-mobile-brand .brand-text strong { color: var(--primary-color); }
@media (min-width: 992px) { .auth-mobile-brand { display: none; } }
.password-toggle { position: absolute; right: 0; top: 0; height: 44px; width: 44px; border: 0; background: transparent; color: var(--muted-color); }
.steps { display: flex; gap: .5rem; margin-bottom: 1.25rem; }
.steps .step { flex: 1; height: 4px; border-radius: 4px; background: var(--border-color); }
.steps .step.done { background: var(--accent-color); }

/* Error pages */
.error-page { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 3rem 1rem; }
.error-code { font-size: clamp(4rem, 14vw, 7rem); font-weight: 800; line-height: 1; color: var(--primary-color); }
.error-code span { color: var(--accent-color); }

/* Sticky footer on short public pages */
body.public { min-height: 100vh; display: flex; flex-direction: column; }
body.public > main { flex: 1 0 auto; }

/* Anti-bot honeypot: off-screen for people (and screen readers), still present for form-filling bots. */
.hp-field { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Password tool (meter, rules, generator) ---------- */
.pw-meter { margin-top: .55rem; }
.pw-bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-bottom: .3rem; }
.pw-bars span { height: 6px; border-radius: 6px; background: var(--border-color); transition: background .25s ease; }
[data-level="1"] .pw-bars span:nth-child(-n+1) { background: var(--danger-color); }
[data-level="2"] .pw-bars span:nth-child(-n+2) { background: var(--warning-color); }
[data-level="3"] .pw-bars span:nth-child(-n+3) { background: var(--success-color); }
[data-level="4"] .pw-bars span { background: var(--success-color); }
[data-level="1"] [data-pw-label] { color: var(--danger-color); font-weight: 700; }
[data-level="2"] [data-pw-label] { color: var(--warning-color); font-weight: 700; }
[data-level="3"] [data-pw-label], [data-level="4"] [data-pw-label] { color: var(--success-color); font-weight: 700; }
.pw-rules { list-style: none; padding: 0; margin: .6rem 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .3rem .9rem; font-size: .8rem; color: var(--muted-color); }
.pw-rules li { display: block; line-height: 1.35; }
.pw-rules li i { margin-right: .35rem; }
.pw-rules li i { color: var(--border-color); transition: color .2s ease; }
.pw-rules li.ok { color: var(--text-color); }
.pw-rules li.ok i { color: var(--success-color); }
.pw-rules .opt { color: var(--muted-color); font-size: .72rem; }
.pw-warning { margin-top: .5rem; padding: .45rem .7rem; border-radius: 8px; background: rgba(var(--warning-rgb), .12); color: var(--text-color); }
.pw-suggestion { margin-top: .7rem; padding: .75rem .9rem; border-radius: 10px; border: 1px dashed rgba(var(--success-rgb), .5); background: rgba(var(--success-rgb), .07); }
.pw-suggestion code { font-size: 1rem; font-weight: 700; letter-spacing: .05em; color: var(--text-color); background: var(--surface-color); padding: .25rem .55rem; border-radius: 6px; border: 1px solid var(--border-color); word-break: break-all; }
.pw-generate { font-weight: 600; font-size: .8rem; text-decoration: none; }
.match-hint { display: block; margin-top: .4rem; font-size: .78rem; }
.match-hint.ok { color: var(--success-color); }
.match-hint.bad { color: var(--danger-color); }

/* Sign-in page feature list (moved here from mediavault.css, which the sign-in page does not load). */
.auth-points { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.auth-points li { display: flex; gap: .75rem; align-items: center; }
.auth-points i { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: rgba(255,255,255,.12); color: var(--accent-color); flex-shrink: 0; }
