:root {
    --bg: #03122f;
    --bg-soft: #0b204e;
    --panel: rgba(6, 24, 62, 0.78);
    --panel-strong: rgba(4, 18, 47, 0.92);
    --line: rgba(107, 196, 255, 0.14);
    --text: #f8fbff;
    --muted: #9fb3d6;
    --blue: #1ca8ff;
    --cyan: #37d7d6;
    --green: #8bd83f;
    --green-soft: rgba(139, 216, 63, 0.18);
    --shadow: 0 28px 80px rgba(0, 0, 0, 0.32);
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 18px;
    --radius-sm: 14px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Plus Jakarta Sans", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(28, 168, 255, 0.18), transparent 24%),
        radial-gradient(circle at top right, rgba(139, 216, 63, 0.2), transparent 22%),
        linear-gradient(180deg, #071635 0%, #020b1d 100%);
}

body.auth-body {
    background: #050b14;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

.ambient {
    position: fixed;
    border-radius: 999px;
    filter: blur(80px);
    pointer-events: none;
    z-index: 0;
}

.ambient-a {
    top: 8%;
    left: -10%;
    width: 280px;
    height: 280px;
    background: rgba(0, 187, 229, 0.22);
}

.ambient-b {
    right: -5%;
    top: 26%;
    width: 220px;
    height: 220px;
    background: rgba(61, 220, 116, 0.18);
}

.ambient-c {
    left: 28%;
    bottom: 10%;
    width: 240px;
    height: 240px;
    background: rgba(26, 86, 197, 0.18);
}

.app-shell {
    position: relative;
    z-index: 1;
    width: min(100%, 1180px);
    margin: 0 auto;
    padding: 24px 18px 110px;
}

.app-shell-auth {
    width: 100%;
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding-top: 24px;
    padding-bottom: 24px;
}

.app-shell-auth .screen {
    width: 100%;
}

.screen {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.screen-tools {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 22px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.brand img {
    width: 46px;
    height: 46px;
    object-fit: contain;
    border-radius: 0;
    box-shadow: none;
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.24));
}

.brand strong,
h1,
h2 {
    font-family: "Sora", sans-serif;
}

.brand span {
    display: inline-flex;
    flex-direction: column;
    gap: 3px;
}

.brand small,
.muted,
.meta-pair span,
.meta-block span,
.field span,
.hero-panel p,
.list-item small,
.timeline-item small,
.profile-head p,
.stat-card span,
.stat-card small,
.alert,
.eyebrow,
.bottom-nav a,
.user-chip small {
    color: var(--muted);
}

.topbar-actions,
.button-row,
.section-head,
.profile-head,
.meta-pair,
.exercise-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.user-chip {
    display: inline-flex;
    flex-direction: column;
    padding: 10px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--line);
}

.stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stack.compact,
.align-end {
    gap: 8px;
}

.align-end {
    align-items: flex-end;
}

.card,
.hero-panel,
.hero-card,
.stat-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    backdrop-filter: blur(20px);
}

.card,
.hero-panel,
.hero-card {
    padding: 22px;
}

.hero-panel,
.hero-card {
    position: relative;
    overflow: hidden;
}

.hero-panel::after,
.hero-card::after {
    content: "";
    position: absolute;
    inset: auto -20% -45% 40%;
    height: 240px;
    background: radial-gradient(circle, rgba(55, 215, 214, 0.22), transparent 65%);
    pointer-events: none;
}

.hero-panel h1,
.hero-card h1,
.section-head h1 {
    margin: 0;
    font-size: clamp(1.9rem, 4vw, 3.3rem);
    line-height: 1.05;
}

h2 {
    margin: 0;
    font-size: 1.15rem;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.72rem;
    font-weight: 700;
}

.hero-metrics,
.stats-grid,
.card-grid,
.content-grid,
.form-grid,
.filter-grid,
.auth-grid {
    display: grid;
    gap: 16px;
}

.hero-metrics {
    margin-top: 18px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.hero-metrics div,
.timeline-item,
.exercise-line,
.list-item,
.info-banner {
    padding: 16px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stat-card {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background:
        linear-gradient(160deg, rgba(28, 168, 255, 0.12), rgba(4, 18, 47, 0.94)),
        var(--panel-strong);
}

.stat-card strong {
    font-size: 1.8rem;
    font-family: "Sora", sans-serif;
}

.content-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.card-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.interactive-card {
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.interactive-card:hover {
    transform: translateY(-3px);
    border-color: rgba(55, 215, 214, 0.3);
    box-shadow: 0 18px 44px rgba(9, 17, 44, 0.36);
}

.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.list-item-static {
    cursor: default;
}

.timeline-item p,
.meta-block p,
.hero-panel p,
.hero-card p {
    margin: 0;
    line-height: 1.7;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(139, 216, 63, 0.12);
    color: #d9f7b4;
    border: 1px solid rgba(139, 216, 63, 0.18);
    white-space: nowrap;
    font-size: 0.84rem;
    font-weight: 700;
}

.button,
.button:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-weight: 700;
    transition: transform 180ms ease, opacity 180ms ease, border-color 180ms ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button.primary {
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    color: #02132f;
}

.button.ghost {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    border-color: var(--line);
}

.button.small {
    min-height: 38px;
    padding: 0 14px;
}

.back-button {
    min-width: 92px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field-grow {
    flex: 1;
}

.field-control {
    width: 100%;
    min-height: 48px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(7, 25, 67, 0.92);
    color: var(--text);
    padding: 0 14px;
    font: inherit;
}

select.field-control {
    color-scheme: dark;
    background:
        linear-gradient(180deg, rgba(17, 53, 111, 0.28), rgba(7, 25, 67, 0.92));
}

select.field-control option,
select.field-control optgroup {
    background: #081a43;
    color: #f8fbff;
}

select.field-control option:checked,
select.field-control option:hover,
select.field-control option:focus {
    background: #123872;
    color: #f8fbff;
}

.field-control-textarea {
    min-height: 120px;
    padding: 14px;
    resize: vertical;
}

.field-control:focus {
    outline: none;
    border-color: rgba(55, 215, 214, 0.45);
    box-shadow: 0 0 0 3px rgba(55, 215, 214, 0.12);
}

.field-control::placeholder {
    color: rgba(159, 179, 214, 0.72);
}

.field-error {
    color: #ffb4b4;
}

.form-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.field-span {
    grid-column: 1 / -1;
}

.filter-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    align-items: end;
}

.filter-bar {
    display: flex;
    gap: 12px;
    align-items: end;
}

.alert {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    background: rgba(55, 215, 214, 0.08);
    border: 1px solid rgba(55, 215, 214, 0.12);
}

.alert.error {
    background: rgba(255, 93, 93, 0.1);
    border-color: rgba(255, 93, 93, 0.2);
    color: #ffd4d4;
}

.text-link {
    color: #8fdfff;
    font-weight: 700;
    font-size: 0.88rem;
}

.media-card {
    padding: 0;
    overflow: hidden;
}

.media-preview {
    position: relative;
    aspect-ratio: 16 / 10;
    background: linear-gradient(135deg, rgba(28, 168, 255, 0.18), rgba(139, 216, 63, 0.08));
}

.media-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-fallback {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 20% 20%, rgba(28, 168, 255, 0.32), transparent 30%),
        linear-gradient(135deg, rgba(55, 215, 214, 0.2), rgba(4, 18, 47, 0.96));
    color: white;
    font-family: "Sora", sans-serif;
}

.media-card .stack {
    padding: 18px;
}

.media-chip {
    position: absolute;
    top: 14px;
    right: 14px;
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(4, 18, 47, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #f8fbff;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.meta-pair,
.meta-block {
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.meta-pair:last-child,
.meta-block:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.meta-block span {
    display: block;
    margin-bottom: 8px;
}

.media-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.media-tile {
    margin: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.media-tile img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.media-video {
    width: 100%;
    aspect-ratio: 4 / 3;
    display: block;
    object-fit: cover;
    background: #020b1d;
}

.media-tile figcaption {
    padding: 12px;
    color: var(--muted);
    font-size: 0.88rem;
}

.auth-grid {
    width: 100%;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    align-items: center;
}

.auth-card {
    max-width: 480px;
    justify-self: end;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.auth-brand img {
    width: 76px;
    height: 76px;
    object-fit: contain;
    border-radius: 24px;
}

.auth-grid-clean {
    min-height: calc(100vh - 48px);
    grid-template-columns: minmax(340px, 500px);
    justify-content: center;
    align-items: center;
}

.auth-grid-video {
    position: relative;
    isolation: isolate;
}

.auth-video-backdrop {
    position: fixed;
    inset: 0;
    overflow: hidden;
    background:
        radial-gradient(circle at 20% 18%, rgba(61, 220, 116, 0.18), transparent 22%),
        radial-gradient(circle at 82% 76%, rgba(0, 187, 229, 0.2), transparent 24%),
        linear-gradient(180deg, #071121 0%, #03070d 100%);
    z-index: 0;
}

.auth-video-media,
.auth-video-overlay,
.auth-video-glow {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.auth-video-media {
    object-fit: cover;
    filter: brightness(0.38) saturate(0.95) contrast(1.04);
}

.auth-video-overlay {
    background:
        linear-gradient(90deg, rgba(3, 7, 13, 0.84) 0%, rgba(3, 7, 13, 0.5) 44%, rgba(3, 7, 13, 0.82) 100%),
        linear-gradient(180deg, rgba(2, 8, 16, 0.46) 0%, rgba(2, 8, 16, 0.72) 100%);
}

.auth-video-glow {
    background:
        radial-gradient(circle at 18% 24%, rgba(61, 220, 116, 0.18), transparent 20%),
        radial-gradient(circle at 74% 14%, rgba(0, 187, 229, 0.14), transparent 18%);
}

.auth-card-clean {
    position: relative;
    width: min(100%, 500px);
    justify-self: center;
    padding: 20px;
    background:
        linear-gradient(180deg, rgba(26, 86, 197, 0.12), rgba(32, 35, 42, 0.96) 22%, rgba(32, 35, 42, 0.98)),
        var(--panel);
    border: 1px solid rgba(0, 187, 229, 0.18);
    border-radius: 32px;
    box-shadow:
        0 32px 80px rgba(32, 35, 42, 0.5),
        inset 0 1px 0 rgba(0, 187, 229, 0.08);
    z-index: 1;
}

.auth-card-clean::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    border-radius: 32px 32px 0 0;
    background: linear-gradient(90deg, #3ddc74 0%, #00bbe5 56%, #1a56c5 100%);
}

.auth-brand-clean {
    justify-content: center;
    margin-bottom: 20px;
    padding: 24px 20px;
    border-radius: 24px;
    background:
        radial-gradient(circle at 24% 26%, rgba(61, 220, 116, 0.32), transparent 24%),
        radial-gradient(circle at 76% 80%, rgba(26, 86, 197, 0.24), transparent 30%),
        linear-gradient(135deg, rgba(0, 187, 229, 0.96), rgba(61, 220, 116, 0.96));
    border: 1px solid rgba(61, 220, 116, 0.32);
    box-shadow:
        inset 0 1px 0 rgba(0, 187, 229, 0.18),
        0 18px 36px rgba(32, 35, 42, 0.24);
}

.auth-brand-clean img {
    width: min(100%, 320px);
    height: auto;
    border-radius: 0;
    box-shadow: none;
}

.login-form-clean {
    gap: 18px;
    padding: 10px 8px 8px;
}

.login-form-clean .field-control {
    min-height: 58px;
    padding-right: 54px;
    padding-left: 16px;
    background: rgba(32, 35, 42, 0.92);
    border-color: rgba(26, 86, 197, 0.32);
    color: rgba(0, 187, 229, 0.96);
    box-shadow: inset 0 1px 0 rgba(0, 187, 229, 0.04);
}

.field-label {
    color: #00bbe5;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.login-form-clean .field-control::placeholder {
    color: rgba(0, 187, 229, 0.42);
}

.login-form-clean .field-control:focus {
    border-color: rgba(61, 220, 116, 0.72);
    box-shadow: 0 0 0 3px rgba(61, 220, 116, 0.14);
}

.password-input-wrap {
    position: relative;
    display: block;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(26, 86, 197, 0.4);
    border-radius: 999px;
    background: rgba(26, 86, 197, 0.18);
    color: #00bbe5;
    cursor: pointer;
}

.password-toggle:hover {
    color: #3ddc74;
    border-color: rgba(61, 220, 116, 0.48);
}

.password-toggle svg {
    width: 20px;
    height: 20px;
}

.auth-submit-button {
    width: 100%;
    min-height: 58px;
    margin-top: 6px;
    border-radius: 18px;
    justify-content: space-between;
    padding: 0 22px;
    font-family: "Sora", sans-serif;
    font-size: 0.96rem;
    background: linear-gradient(135deg, #1a56c5 0%, #00bbe5 100%);
    color: #20232a;
    box-shadow: 0 18px 36px rgba(26, 86, 197, 0.32);
}

.auth-submit-button svg {
    width: 20px;
    height: 20px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.bottom-nav {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    width: min(calc(100% - 24px), 560px);
    padding: 10px;
    border-radius: 999px;
    background: rgba(4, 18, 47, 0.88);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
    z-index: 5;
}

.bottom-nav a {
    flex: 1;
    min-height: 44px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 0.92rem;
}

.bottom-nav a.active {
    color: var(--text);
    background: rgba(55, 215, 214, 0.12);
}

@media (max-width: 720px) {
    .app-shell {
        padding: 16px 14px 104px;
    }

    .topbar,
    .section-head,
    .filter-bar,
    .button-row,
    .profile-head,
    .exercise-line {
        flex-direction: column;
        align-items: stretch;
    }

    .auth-card {
        max-width: none;
        justify-self: stretch;
    }

    .auth-card-clean {
        width: 100%;
        padding: 18px;
    }

    .auth-brand-clean img {
        width: min(100%, 280px);
    }

    .button,
    .button.small {
        width: 100%;
    }

    .bottom-nav {
        width: calc(100% - 20px);
    }
}
