:root {
    --color-primary: #0d3257;
    --color-primary-strong: #09233d;
    --color-primary-soft: #edf4fb;

    --color-accent: #ea5635;
    --color-accent-strong: #cf4527;
    --color-accent-soft: #fff2ed;

    --color-white: #ffffff;
    --color-black: #000000;

    --color-bg: #f4f7fb;
    --color-bg-soft: #f8fbfe;
    --color-bg-panel: #eef3f8;
    --color-bg-muted: #f3f6fa;

    --color-text: #172534;
    --color-text-soft: #607080;
    --color-text-faint: #8593a0;

    --color-border: #d8e1ea;
    --color-border-strong: #c8d3de;

    --color-success: #177245;
    --color-success-bg: #edf8f1;
    --color-success-border: #cfead9;

    --color-warning: #9a6700;
    --color-warning-bg: #fff8e8;
    --color-warning-border: #f1dfb0;

    --color-danger: #a12727;
    --color-danger-bg: #fff1f1;
    --color-danger-border: #f2caca;

    --color-info: #0d3257;
    --color-info-bg: #edf5ff;
    --color-info-border: #cfe0f8;

    --shadow-xs: 0 1px 2px rgba(13, 50, 87, 0.03);
    --shadow-sm: 0 8px 20px rgba(13, 50, 87, 0.05);
    --shadow-md: 0 14px 34px rgba(13, 50, 87, 0.07);
    --shadow-lg: 0 22px 54px rgba(13, 50, 87, 0.09);

    --font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;

    --font-size-xs: 11px;
    --font-size-sm: 12px;
    --font-size-md: 13px;
    --font-size-base: 14px;
    --font-size-lg: 15px;
    --font-size-xl: 17px;
    --font-size-2xl: 20px;
    --font-size-3xl: 24px;
    --font-size-4xl: 30px;

    --line-tight: 1.2;
    --line-normal: 1.45;
    --line-relaxed: 1.65;

    --container: 1720px;
    --container-auth: 1360px;
    --header-height: 70px;
    --footer-height: 52px;

    --anim-fast: .18s;
    --anim-base: .38s;
    --anim-slow: .6s;
    --anim-ease: cubic-bezier(.22,1,.36,1);
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body.app-body {
    margin: 0;
    min-width: 320px;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: var(--line-normal);
    color: var(--color-text);
    background:
        radial-gradient(circle at top right, rgba(13, 50, 87, 0.04), transparent 24%),
        radial-gradient(circle at bottom left, rgba(234, 86, 53, 0.04), transparent 28%),
        linear-gradient(180deg, #f8fafc 0%, #eff4f9 100%);
}

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

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

button,
input,
select,
textarea {
    font: inherit;
    border-radius: 0;
}

input::-ms-reveal,
input::-ms-clear {
    display: none;
}

::placeholder {
    color: #97a4af;
    opacity: 1;
}

:focus-visible {
    outline: 0;
}

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding-left: 28px;
    padding-right: 28px;
}

.app-main {
    flex: 1 1 auto;
    padding-top: 24px;
    padding-bottom: 32px;
}

.app-main.app-main-auth {
    padding-top: 0;
    padding-bottom: 0;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 200;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)),
        linear-gradient(180deg, #0d3257 0%, #0a2743 100%);
    border-bottom: 3px solid var(--color-accent);
    box-shadow: 0 10px 24px rgba(8, 31, 54, 0.15);
}

.app-header-inner {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding-top: 10px;
    padding-bottom: 10px;
}

.app-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
}

.app-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    color: var(--color-white);
}

.app-brand-logo {
    display: block;
    height: 34px;
    width: auto;
}

.app-brand-text {
    font-size: 22px;
    font-weight: 850;
    letter-spacing: 0.01em;
    line-height: 1;
    white-space: nowrap;
}

.app-header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.app-menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    appearance: none;
    -webkit-appearance: none;
}

.app-menu-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: #ffffff;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.app-footer {
    border-top: 1px solid var(--color-border);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
}

.app-footer-inner {
    min-height: var(--footer-height);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-soft);
    font-size: 12px;
    font-weight: 500;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    appearance: none;
    -webkit-appearance: none;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.btn:hover,
.btn:focus-visible {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(180deg, #123d68 0%, #0d3257 100%);
    border-color: #0d3257;
    color: var(--color-white);
    box-shadow: 0 8px 18px rgba(13, 50, 87, 0.14);
}

.btn-primary:hover,
.btn-primary:focus-visible {
    background: linear-gradient(180deg, #0f365d 0%, #09233d 100%);
    border-color: #09233d;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    display: inline-block;
    color: var(--color-primary);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
}

.form-control {
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid #cfdae4;
    background: #ffffff;
    color: var(--color-text);
    box-shadow: inset 0 1px 1px rgba(13, 50, 87, 0.015);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.form-control:hover {
    border-color: #c1cfdb;
}

.form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(13, 50, 87, 0.07);
    outline: none;
}

.alert {
    padding: 12px 14px;
    border: 1px solid transparent;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
}

.alert-success {
    background: var(--color-success-bg);
    border-color: var(--color-success-border);
    color: var(--color-success);
}

.alert-danger {
    background: var(--color-danger-bg);
    border-color: var(--color-danger-border);
    color: var(--color-danger);
}

.auth-page {
    min-height: calc(100vh - var(--header-height) - var(--footer-height));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px 0 28px;
}

.auth-shell {
    width: 100%;
    max-width: var(--container-auth);
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    background: linear-gradient(90deg, rgba(247, 241, 240, 0.5) 0%, rgba(235, 240, 246, 0.58) 100%);
    border: 1px solid #dbe3ec;
    box-shadow: 0 18px 44px rgba(13, 50, 87, 0.08);
}

.auth-brand-panel {
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    padding: 28px 0 28px 28px;
}

.auth-brand-box {
    position: relative;
    width: 100%;
    min-height: 100%;
    overflow: hidden;
    background: linear-gradient(135deg, #123f6d 0%, #0d3257 58%, #214f81 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.auth-brand-box::before,
.auth-brand-box::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

.auth-brand-box::before {
    inset: 0;
    background:
        linear-gradient(163deg, transparent 0 64%, rgba(255, 255, 255, 0.08) 64.2%, transparent 64.4%),
        linear-gradient(347deg, transparent 0 79%, rgba(255, 255, 255, 0.07) 79.2%, transparent 79.4%);
}

.auth-brand-box::after {
    left: -20px;
    bottom: -26px;
    width: 180px;
    height: 180px;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    transform: rotate(-12deg);
}

.auth-brand-inner {
    position: relative;
    z-index: 1;
    padding: 32px 30px 28px;
}

.auth-kicker {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    margin-bottom: 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.08);
    color: #fff3ed;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.auth-brand-title {
    margin: 0 0 12px;
    max-width: 560px;
    color: var(--color-white);
    font-size: 28px;
    line-height: 1.12;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.auth-brand-text {
    margin: 0;
    max-width: 560px;
    color: rgba(255, 255, 255, 0.92);
    font-size: 13px;
    line-height: 1.7;
    font-weight: 600;
}

.auth-feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 22px;
}

.auth-feature-card {
    min-height: 90px;
    padding: 12px 12px 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.07);
}

.auth-feature-card strong {
    display: block;
    margin-bottom: 6px;
    color: var(--color-white);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.3;
}

.auth-feature-card span {
    display: block;
    color: rgba(255, 255, 255, 0.88);
    font-size: 11px;
    line-height: 1.5;
    font-weight: 600;
}

.auth-mini-graphic {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    height: 60px;
    margin-top: 28px;
}

.auth-mini-graphic span {
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.12);
}

.auth-mini-graphic span:nth-child(1) {
    width: 34px;
    height: 20px;
}

.auth-mini-graphic span:nth-child(2) {
    width: 34px;
    height: 34px;
}

.auth-mini-graphic span:nth-child(3) {
    width: 34px;
    height: 48px;
}

.auth-mini-graphic span:nth-child(4) {
    width: 34px;
    height: 28px;
}

.auth-form-panel {
    display: flex;
    align-items: stretch;
    justify-content: stretch;
    padding: 28px 28px 28px 0;
}

.auth-card {
    width: 100%;
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid #dbe3ec;
    box-shadow: none;
}

.auth-card-body {
    padding: 30px 32px;
}

.auth-card-header {
    margin-bottom: 18px;
}

.auth-title {
    margin: 0 0 8px;
    color: var(--color-primary);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.12;
}

.auth-subtitle {
    margin: 0;
    max-width: 430px;
    color: #55677a;
    font-size: 13px;
    line-height: 1.55;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-top: 2px;
}

.auth-submit {
    min-width: 132px;
}

.auth-note {
    margin-top: 2px;
    padding-top: 14px;
    border-top: 1px solid #e1e7ee;
    color: #617587;
    font-size: 11px;
    line-height: 1.6;
}

.reveal,
.reveal-up,
.reveal-left,
.reveal-right,
.reveal-zoom {
    opacity: 0;
    transform: translateY(24px);
    transition:
        opacity var(--anim-base) var(--anim-ease),
        transform var(--anim-base) var(--anim-ease);
}

.reveal-up {
    transform: translateY(26px);
}

.reveal-left {
    transform: translateX(26px);
}

.reveal-right {
    transform: translateX(-26px);
}

.reveal-zoom {
    transform: translateY(20px) scale(.96);
}

.reveal.is-visible,
.reveal-up.is-visible,
.reveal-left.is-visible,
.reveal-right.is-visible,
.reveal-zoom.is-visible {
    opacity: 1;
    transform: none;
}

.reveal-delay-1 { transition-delay: .06s; }
.reveal-delay-2 { transition-delay: .12s; }
.reveal-delay-3 { transition-delay: .18s; }
.reveal-delay-4 { transition-delay: .24s; }

@media (min-width: 769px) {
    .app-header-inner {
        flex-direction: row;
    }

    .app-header-top {
        width: auto;
        flex: 0 0 auto;
    }

    .app-header-right {
        display: flex !important;
        align-items: center;
        justify-content: flex-end;
        gap: 12px;
        flex-wrap: wrap;
        width: auto;
    }
}

@media (max-width: 1200px) {
    .auth-page {
        padding: 20px 0 26px;
    }

    .auth-shell {
        max-width: 1080px;
    }

    .auth-card-body {
        padding: 26px 26px;
    }

    .auth-brand-inner {
        padding: 28px 26px 24px;
    }
}

@media (max-width: 980px) {
    .auth-shell {
        grid-template-columns: 1fr;
        max-width: 820px;
    }

    .auth-brand-panel {
        padding: 20px 20px 0 20px;
    }

    .auth-form-panel {
        padding: 0 20px 20px 20px;
    }

    .auth-feature-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .app-main {
        padding-top: 18px;
        padding-bottom: 24px;
    }

    .app-header-inner {
        min-height: auto;
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    .app-brand-logo {
        height: 30px;
    }

    .app-brand-text {
        font-size: 20px;
    }

    .app-menu-toggle {
        display: inline-flex;
        flex: 0 0 auto;
    }

    .app-header-right {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 8px;
        padding-top: 2px;
    }

    .app-header-right.is-open {
        display: flex;
    }

    .auth-page {
        min-height: auto;
        padding: 14px 0 20px;
    }

    .auth-shell {
        box-shadow: 0 12px 28px rgba(13, 50, 87, 0.07);
    }

    .auth-brand-title {
        font-size: 24px;
    }

    .auth-card-body,
    .auth-brand-inner {
        padding: 22px 18px;
    }

    .auth-actions {
        justify-content: stretch;
    }

    .auth-submit {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 560px) {
    .app-brand-text {
        font-size: 18px;
    }

    .app-brand-logo {
        height: 28px;
    }

    .auth-brand-title {
        font-size: 22px;
    }

    .auth-subtitle,
    .auth-brand-text {
        font-size: 12px;
    }

    .auth-feature-card {
        min-height: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }

    .reveal,
    .reveal-up,
    .reveal-left,
    .reveal-right,
    .reveal-zoom {
        opacity: 1 !important;
        transform: none !important;
    }
}