:root {
    --bg: #050816;
    --bg-soft: #0b1328;
    --panel: rgba(8, 15, 34, 0.82);
    --panel-strong: rgba(11, 19, 40, 0.88);
    --text: #eef4ff;
    --muted: #8ea2c9;
    --line: rgba(141, 170, 255, 0.14);
    --brand: #36a3ff;
    --brand-strong: #1f6fff;
    --brand-glow: rgba(54, 163, 255, 0.35);
    --danger: #ff667a;
    --success: #4fe0a1;
    --shadow: 0 30px 80px rgba(0, 0, 0, 0.42);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Manrope", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 15% 20%, rgba(31, 111, 255, 0.24), transparent 0 24%),
        radial-gradient(circle at 85% 15%, rgba(54, 163, 255, 0.18), transparent 0 22%),
        radial-gradient(circle at 50% 85%, rgba(103, 76, 255, 0.12), transparent 0 26%),
        linear-gradient(160deg, #030510 0%, #07101f 42%, #0a1630 100%);
    overflow-x: hidden;
}

.scene {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(110, 149, 255, 0.08) 1px, transparent 1px),
        linear-gradient(rgba(110, 149, 255, 0.08) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.85), transparent 92%);
}

.scene::before,
.scene::after {
    content: "";
    position: absolute;
    border-radius: 999px;
    filter: blur(90px);
    opacity: 0.65;
    animation: drift 14s ease-in-out infinite;
}

.scene::before {
    width: 280px;
    height: 280px;
    top: 10%;
    left: -4%;
    background: rgba(33, 125, 255, 0.22);
}

.scene::after {
    width: 360px;
    height: 360px;
    right: -8%;
    bottom: 6%;
    background: rgba(43, 96, 241, 0.2);
    animation-delay: -6s;
}

.shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 56px 0;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 28px;
    position: relative;
    z-index: 1;
}

.intro,
.panel,
.card {
    backdrop-filter: blur(18px);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    animation: rise 0.8s ease both;
}

.intro {
    padding: 46px;
    border-radius: 32px;
    background:
        linear-gradient(180deg, rgba(14, 25, 55, 0.92), rgba(7, 12, 29, 0.92)),
        linear-gradient(120deg, rgba(54, 163, 255, 0.12), transparent 40%);
    position: relative;
    overflow: hidden;
}

.panel {
    padding: 26px 26px 24px;
    border-radius: 24px;
    background: var(--panel);
    animation-delay: 0.12s;
    overflow: visible;
}

.intro::before {
    content: "";
    position: absolute;
    inset: auto -90px -120px auto;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(54, 163, 255, 0.2), transparent 65%);
}

.intro-bar {
    width: 84px;
    height: 5px;
    margin: 0 0 22px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--brand), #87c6ff);
    box-shadow: 0 0 24px var(--brand-glow);
}

.eyebrow {
    display: inline-block;
    margin-bottom: 12px;
    font-size: 0.78rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #7cc3ff;
}

h1,
h2,
h3,
h4,
p {
    margin-top: 0;
}

h1 {
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(2.3rem, 5vw, 4.4rem);
    line-height: 0.92;
    margin-bottom: 18px;
    max-width: 10ch;
    letter-spacing: -0.05em;
}

.intro p,
.muted {
    color: var(--muted);
    line-height: 1.7;
}

.hero-copy {
    max-width: 24ch;
    margin: 0;
    font-size: 1.05rem;
    color: #d8e7ff;
}

.role-list,
.grid-roles,
.stats {
    display: grid;
    gap: 12px;
}

.role-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(54, 163, 255, 0.08);
    color: #b9ddff;
    font-size: 0.9rem;
    border: 1px solid rgba(88, 168, 255, 0.18);
    transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.role-pill:hover {
    transform: translateY(-2px);
    border-color: rgba(88, 168, 255, 0.35);
    background: rgba(54, 163, 255, 0.14);
}

.tabs {
    position: relative;
    display: inline-flex;
    gap: 0;
    padding: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    margin-bottom: 18px;
    border: 1px solid rgba(141, 170, 255, 0.16);
    overflow: hidden;
    isolation: isolate;
    min-width: 248px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.tab-slider {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    border-radius: 999px;
    background: linear-gradient(135deg, #4ab3ff 0%, #2f7dff 52%, #1b56e8 100%);
    box-shadow:
        0 8px 20px rgba(31, 111, 255, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 0;
}

.tabs.is-register .tab-slider {
    transform: translateX(100%);
}

.tab {
    appearance: none;
    border: 0;
    position: relative;
    z-index: 1;
    flex: 1 1 50%;
    text-align: center;
    padding: 9px 16px;
    border-radius: 999px;
    text-decoration: none;
    color: #b1c4e8;
    font-size: 0.93rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    transition: color 0.22s ease, transform 0.22s ease;
    background: transparent;
    box-shadow: none;
    cursor: pointer;
}

.tab.is-active {
    color: #fff;
    text-shadow: 0 1px 8px rgba(11, 28, 95, 0.35);
}

.tab:hover {
    color: #e8f2ff;
}

.card-form,
.inline-form {
    display: grid;
    gap: 10px;
}

.remember-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 2px 0 4px;
    cursor: pointer;
    user-select: none;
    font-size: 0.9rem;
    color: #dbe8ff;
}

.remember-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-height: 16px;
    margin: 0;
    accent-color: #2f7dff;
    transform: translateY(-1px);
}

.forms-stage {
    position: relative;
    min-height: 352px;
    overflow: visible;
}

.auth-pane {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateX(18px) scale(0.992);
    pointer-events: none;
    transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s ease;
}

.auth-pane.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(0) scale(1);
    pointer-events: auto;
    z-index: 1;
}

label {
    font-weight: 600;
    font-size: 0.84rem;
    color: #c9dbfb;
    letter-spacing: 0.01em;
    margin-top: 2px;
}

input,
select,
button {
    font: inherit;
}

input,
select {
    width: 100%;
    min-height: 46px;
    padding: 11px 14px;
    border-radius: 13px;
    border: 1px solid rgba(107, 138, 211, 0.18);
    background: rgba(7, 15, 31, 0.9);
    color: var(--text);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

input:focus,
select:focus {
    border-color: rgba(84, 170, 255, 0.75);
    background: rgba(10, 19, 39, 0.98);
    box-shadow: 0 0 0 3px rgba(54, 163, 255, 0.13);
    transform: translateY(-1px);
}

button {
    border: 0;
    border-radius: 13px;
    min-height: 46px;
    padding: 11px 16px;
    background: linear-gradient(135deg, var(--brand), var(--brand-strong));
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(31, 111, 255, 0.24);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(31, 111, 255, 0.28);
    filter: brightness(1.04);
}

button.ghost {
    background: transparent;
    color: #cbe5ff;
    border: 1px solid rgba(84, 170, 255, 0.22);
    box-shadow: none;
}

.notice {
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 0.92rem;
    font-weight: 600;
    border: 1px solid var(--line);
}

.notice-error {
    background: rgba(255, 102, 122, 0.12);
    color: var(--danger);
}

.notice-success {
    background: rgba(79, 224, 161, 0.1);
    color: var(--success);
}

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

.stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 24px;
}

.stats article,
.role-card,
.card {
    background: var(--panel-strong);
    border-radius: 22px;
}

.stats article {
    padding: 18px;
    border: 1px solid var(--line);
    position: relative;
    overflow: hidden;
}

.stats article::after {
    content: "";
    position: absolute;
    inset: auto -30px -50px auto;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(54, 163, 255, 0.16), transparent 65%);
}

.stats strong {
    display: block;
    font-size: 1.6rem;
    margin-bottom: 6px;
    font-family: "Space Grotesk", sans-serif;
}

.card {
    padding: 22px;
    margin-top: 18px;
}

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

.role-card {
    padding: 18px;
    border: 1px solid var(--line);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.role-card:hover {
    transform: translateY(-4px);
    border-color: rgba(84, 170, 255, 0.28);
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.22);
}

.role-card small {
    color: var(--muted);
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    padding: 14px 10px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
}

th {
    color: #9bc7ff;
    font-size: 0.84rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.inline-form {
    grid-template-columns: minmax(170px, 1fr) auto;
    align-items: center;
}

::placeholder {
    color: #6e83aa;
    font-size: 0.94rem;
}

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

@keyframes drift {
    0%,
    100% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    50% {
        transform: translate3d(0, -16px, 0) scale(1.06);
    }
}

@media (max-width: 900px) {
    .shell {
        grid-template-columns: 1fr;
        width: min(100%, calc(100% - 24px));
        padding: 18px 0 32px;
        gap: 16px;
    }

    .intro,
    .panel {
        padding: 22px 18px;
        border-radius: 24px;
    }

    .intro {
        min-height: auto;
    }

    h1 {
        max-width: none;
        margin-bottom: 12px;
    }

    .hero-copy {
        max-width: none;
        font-size: 0.98rem;
    }

    .tabs {
        width: 100%;
        min-width: 0;
        margin-bottom: 14px;
    }

    .tab {
        min-height: 44px;
        padding: 10px 12px;
        font-size: 0.92rem;
    }

    .forms-stage {
        min-height: 330px;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    .dashboard-head {
        flex-direction: column;
    }

    .inline-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    body {
        background:
            radial-gradient(circle at 20% 12%, rgba(31, 111, 255, 0.28), transparent 0 28%),
            radial-gradient(circle at 82% 12%, rgba(54, 163, 255, 0.2), transparent 0 24%),
            linear-gradient(180deg, #030510 0%, #07101f 48%, #0a1630 100%);
    }

    .scene {
        background-size: 34px 34px;
        opacity: 0.7;
    }

    .shell {
        width: min(100%, calc(100% - 16px));
        padding: 12px 0 24px;
        gap: 12px;
    }

    .intro,
    .panel {
        padding: 18px 14px;
        border-radius: 20px;
        box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
    }

    .eyebrow {
        margin-bottom: 8px;
        font-size: 0.7rem;
        letter-spacing: 0.18em;
    }

    h1 {
        font-size: clamp(1.9rem, 12vw, 2.7rem);
        line-height: 0.94;
    }

    .intro-bar {
        width: 64px;
        height: 4px;
        margin-bottom: 14px;
    }

    .hero-copy {
        font-size: 0.93rem;
        line-height: 1.5;
    }

    .tabs {
        padding: 3px;
        border-radius: 16px;
    }

    .tab-slider {
        top: 3px;
        left: 3px;
        width: calc(50% - 3px);
        height: calc(100% - 6px);
        border-radius: 13px;
    }

    .tab {
        padding: 10px 8px;
        min-height: 42px;
        border-radius: 13px;
        font-size: 0.88rem;
    }

    .forms-stage {
        min-height: 318px;
    }

    .card-form,
    .inline-form {
        gap: 9px;
    }

    label {
        font-size: 0.8rem;
    }

    input,
    select,
    button {
        font-size: 16px;
    }

    input,
    select {
        min-height: 44px;
        padding: 10px 12px;
        border-radius: 12px;
    }

    button {
        min-height: 44px;
        padding: 10px 14px;
        border-radius: 12px;
    }

    .remember-row {
        font-size: 0.85rem;
        gap: 8px;
    }

    .notice {
        margin-bottom: 12px;
        padding: 9px 10px;
        border-radius: 10px;
        font-size: 0.86rem;
    }
}
