:root {
    --orange: #ff7a18;
    --orange-deep: #e85d04;
    --orange-soft: #ff9a4a;
    --purple: #8b5cf6;
    --blue: #3b82f6;
    --bg: #070b14;
    --panel: #101826;
    --panel-2: #0c1320;
    --text: #f8fafc;
    --muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.1);
    --input: rgba(8, 13, 24, 0.72);
    --danger: #fb7185;
    --ok: #34d399;
    --shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
    --radius: 28px;
    --font: "Inter", system-ui, -apple-system, sans-serif;
}

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

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
}

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

button,
input {
    font-family: inherit;
}

.auth-body {
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(255, 122, 24, 0.12), transparent 55%),
        radial-gradient(900px 500px at 110% 110%, rgba(139, 92, 246, 0.14), transparent 50%),
        #070b14;
}

.auth-glow {
    position: fixed;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    filter: blur(90px);
    pointer-events: none;
    z-index: 0;
}

.auth-glow--orange {
    top: -120px;
    left: -80px;
    background: rgba(255, 122, 24, 0.16);
}

.auth-glow--purple {
    right: -80px;
    bottom: -140px;
    background: rgba(139, 92, 246, 0.18);
}

.auth-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px 20px 20px;
}

.login-card {
    width: min(1180px, 100%);
    min-height: min(680px, calc(100vh - 92px));
    display: grid;
    grid-template-columns: 1.08fr 0.92fr;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--panel);
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.06);
    animation: cardIn 0.7s ease both;
}

.login-card--narrow {
    width: min(480px, 100%);
    min-height: auto;
    grid-template-columns: 1fr;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.brand-panel {
    position: relative;
    overflow: hidden;
    min-height: 640px;
}

.brand-photo,
.brand-scrim,
.network-overlay {
    position: absolute;
    inset: 0;
}

.brand-photo {
    background-size: cover;
    background-position: left center;
    transform: scale(1.04);
}

.brand-scrim {
    background:
        linear-gradient(180deg, rgba(6, 10, 20, 0.55) 0%, rgba(6, 10, 20, 0.22) 38%, rgba(6, 10, 20, 0.78) 100%),
        linear-gradient(90deg, rgba(7, 11, 20, 0.18) 0%, rgba(16, 24, 38, 0.55) 100%);
}

.network-overlay {
    width: 100%;
    height: 100%;
    opacity: 0.72;
}

.node {
    transform-origin: center;
    animation: pulse 3.6s ease-in-out infinite;
}

.node-b,
.node-f,
.node-j { animation-delay: 0.6s; }
.node-c,
.node-g { animation-delay: 1.2s; }
.node-d,
.node-h { animation-delay: 1.8s; }

@keyframes pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.brand-content {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 36px 40px 32px;
}

.brand-logo img {
    width: min(248px, 72%);
    height: auto;
    mix-blend-mode: screen;
    filter: saturate(1.08) contrast(1.05);
}

.brand-logo--center {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

.brand-logo--center img {
    width: 220px;
    mix-blend-mode: screen;
}

.brand-hero {
    margin: 0;
    font-size: clamp(28px, 3.1vw, 42px);
    line-height: 1.18;
    font-weight: 700;
    letter-spacing: -0.03em;
    text-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.feature-row {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 0;
    margin: 0;
}

.feature-row li {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.92);
}

.feature-icon {
    width: 36px;
    height: 36px;
    color: var(--orange);
    display: grid;
    place-items: center;
}

.feature-icon svg {
    width: 26px;
    height: 26px;
}

.form-panel {
    background: linear-gradient(180deg, #121b2b 0%, #0d1522 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 52px;
}

.form-panel--solo {
    padding: 48px 40px 40px;
}

.form-inner {
    width: 100%;
    max-width: 380px;
}

.welcome-icon {
    width: 54px;
    height: 54px;
    margin: 0 auto 18px;
    border: 1.5px solid rgba(255, 122, 24, 0.55);
    border-radius: 50%;
    color: var(--orange-soft);
    display: grid;
    place-items: center;
    background: rgba(255, 122, 24, 0.06);
}

.welcome-icon svg {
    width: 26px;
    height: 26px;
}

.form-inner h2 {
    margin: 0;
    text-align: center;
    font-size: 32px;
    letter-spacing: -0.03em;
    font-weight: 800;
}

.form-subtitle {
    margin: 8px 0 28px;
    text-align: center;
    color: var(--muted);
    font-size: 14.5px;
}

.field {
    position: relative;
    display: block;
    margin-bottom: 14px;
}

.field input {
    width: 100%;
    height: 52px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: var(--input);
    color: var(--text);
    padding: 0 44px 0 46px;
    font-size: 14.5px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.field input::placeholder {
    color: #7b889c;
}

.field input:focus {
    border-color: rgba(255, 122, 24, 0.7);
    box-shadow: 0 0 0 4px rgba(255, 122, 24, 0.12);
    background: rgba(8, 13, 24, 0.92);
}

.field-icon,
.toggle-password {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    color: #8b97a8;
    pointer-events: none;
}

.field-icon {
    left: 4px;
}

.field-icon svg,
.toggle-password svg {
    width: 18px;
    height: 18px;
}

.toggle-password {
    right: 4px;
    pointer-events: auto;
    background: none;
    border: 0;
    color: #9aa6b8;
    cursor: pointer;
    border-radius: 8px;
}

.toggle-password:hover {
    color: var(--text);
}

.form-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 6px 0 20px;
    font-size: 13.5px;
}

.remember {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #dbe4f0;
    user-select: none;
}

.remember input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.remember .box {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: #0b1220;
    position: relative;
}

.remember input:checked + .box {
    background: linear-gradient(180deg, var(--orange-soft), var(--orange-deep));
    border-color: transparent;
}

.remember input:checked + .box::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.forgot {
    color: var(--orange);
    text-decoration: none;
    font-weight: 600;
}

.forgot:hover {
    color: var(--orange-soft);
}

.btn-primary,
.btn-ghost {
    width: 100%;
    height: 52px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
    border: 0;
    color: #fff;
    background: linear-gradient(90deg, #ff8a1f 0%, #ff6a12 48%, #e85d04 100%);
    box-shadow: 0 10px 24px rgba(255, 106, 18, 0.32);
}

.btn-primary:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary.is-loading {
    pointer-events: none;
    opacity: 0.86;
}

.btn-spinner {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    animation: spin 0.7s linear infinite;
}

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

.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 16px;
    color: #6d7b90;
    font-size: 13px;
}

.divider::before,
.divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

.btn-ghost {
    background: transparent;
    color: #e2e8f0;
    border: 1px solid rgba(148, 163, 184, 0.28);
    letter-spacing: 0.04em;
    text-transform: none;
    font-weight: 600;
    font-size: 14.5px;
}

.btn-ghost svg {
    width: 18px;
    height: 18px;
    color: var(--orange);
}

.btn-ghost:hover {
    border-color: rgba(255, 122, 24, 0.45);
    background: rgba(255, 122, 24, 0.05);
}

.btn-compact {
    width: auto;
    height: 40px;
    padding: 0 16px;
    letter-spacing: 0;
    text-transform: none;
    text-decoration: none;
}

.alert {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.45;
    background: rgba(251, 113, 133, 0.1);
    border: 1px solid rgba(251, 113, 133, 0.28);
    color: #fecdd3;
}

.alert--ok {
    background: rgba(52, 211, 153, 0.1);
    border-color: rgba(52, 211, 153, 0.28);
    color: #bbf7d0;
}

.hp {
    position: absolute;
    left: -9999px;
    opacity: 0;
}

.auth-footer {
    margin: 18px 0 0;
    color: #64748b;
    font-size: 12.5px;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%) translateY(12px);
    background: #121a28;
    color: #fff;
    border: 1px solid rgba(139, 92, 246, 0.35);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 13.5px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
    z-index: 20;
    opacity: 0;
    transition: 0.25s ease;
}

.toast.is-on {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.back-link {
    display: block;
    margin-top: 18px;
    text-align: center;
    color: var(--orange);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.app-body {
    min-height: 100vh;
    background: #070b14;
}

.app-topbar {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: #0d1522;
}

.topbar-brand img {
    height: 42px;
    width: auto;
    mix-blend-mode: screen;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-user strong {
    display: block;
    font-size: 14px;
}

.topbar-user small {
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 11px;
}

.app-welcome {
    padding: 48px 24px;
    display: grid;
    place-items: center;
}

.welcome-card {
    width: min(640px, 100%);
    background: #101826;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 36px;
    box-shadow: var(--shadow);
}

.welcome-card h1 {
    margin: 0 0 10px;
    letter-spacing: -0.03em;
}

.welcome-card p {
    margin: 0;
    color: var(--muted);
}

@media (max-width: 980px) {
    .login-card {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .brand-panel {
        min-height: 280px;
    }

    .brand-hero {
        font-size: 26px;
        margin: 18px 0;
    }

    .feature-row {
        display: none;
    }

    .form-panel {
        padding: 36px 24px 40px;
    }

    .brand-content {
        padding: 24px;
    }
}
