:root {
    --legger-red: #FE544A;
    --legger-blue: #081F2D;
    --legger-blue-soft: #0E3044;
    --legger-ink: #102333;
    --legger-muted: #6E7D88;
    --legger-line: rgba(8, 31, 45, 0.12);
    --legger-white: #FFFFFF;
    --legger-cream: #F7F4F0;
    --radius-xl: 22px;
    --radius-md: 12px;
    --shadow: 0 18px 48px rgba(3, 15, 24, 0.22);
}

* {
    box-sizing: border-box;
}

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

body {
    min-height: 100vh;
    font-family: "Aptos", "Segoe UI", sans-serif;
    color: var(--legger-ink);
    background:
        radial-gradient(circle at 12% 18%, rgba(254, 84, 74, 0.18), transparent 26%),
        linear-gradient(135deg, #061823 0%, var(--legger-blue) 48%, #0C2D40 100%);
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
    background-size: 36px 36px;
    mask-image: linear-gradient(120deg, rgba(0,0,0,0.78), transparent 65%);
}

.login-site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 56px;
    padding: 0 clamp(22px, 5vw, 72px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--legger-blue);
    border-bottom: 2px solid var(--legger-red);
    box-shadow: 0 8px 22px rgba(8, 31, 45, 0.14);
}

.login-header-spacer {
    width: 1px;
    height: 1px;
}

.login-header-brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.login-header-brand img {
    display: block;
    width: 118px;
    height: auto;
}

.auth-shell {
    position: relative;
    width: min(1040px, calc(100% - 40px));
    min-height: calc(100vh - 58px);
    margin: 0 auto;
    padding: 24px 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 400px);
    gap: clamp(22px, 5vw, 58px);
    align-items: center;
}

.auth-hero {
    color: var(--legger-white);
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--legger-red);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.34em;
}

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

h1 {
    max-width: 540px;
    margin-bottom: 14px;
    font-size: clamp(32px, 5.4vw, 52px);
    line-height: 0.98;
    letter-spacing: 0;
}

.lead {
    max-width: 520px;
    margin-bottom: 0;
    color: rgba(255, 255, 255, 0.76);
    font-size: 13px;
    line-height: 1.55;
}

.auth-card {
    position: relative;
    padding: 26px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: var(--radius-xl);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-accent {
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    /* background: linear-gradient(90deg, var(--legger-red), #FF8D86); */
}

.panel-header {
    position: relative;
    margin-bottom: 18px;
}

.login-chip {
    display: inline-flex;
    margin-bottom: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(254, 84, 74, 0.1);
    color: var(--legger-red);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h2 {
    margin-bottom: 6px;
    color: var(--legger-blue);
    font-size: 22px;
    letter-spacing: 0;
}

.panel-header p {
    margin-bottom: 0;
    color: var(--legger-muted);
    font-size: 12.5px;
    line-height: 1.45;
}

.stack,
.field-group {
    display: grid;
    gap: 10px;
}

.stack {
    gap: 12px;
}

label {
    color: var(--legger-blue);
    font-size: 11px;
    font-weight: 600;
}

input,
select,
button {
    font: inherit;
}

input,
select {
    width: 100%;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--legger-line);
    border-radius: var(--radius-md);
    background: #FAFBFC;
    color: var(--legger-blue);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input::placeholder {
    color: #9AA6AE;
}

input:focus,
select:focus {
    border-color: rgba(254, 84, 74, 0.72);
    background: var(--legger-white);
    box-shadow: 0 0 0 4px rgba(254, 84, 74, 0.13);
}

.security-note {
    color: var(--legger-muted);
    font-size: 9.8px;
    line-height: 1.35;
}

.login-button {
    min-height: 46px;
    margin-top: 2px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--legger-red), #E84339);
    color: var(--legger-white);
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(254, 84, 74, 0.24);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.login-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 42px rgba(254, 84, 74, 0.4);
}

.auth-link {
    display: inline-flex;
    justify-content: center;
    color: var(--legger-blue);
    font-size: 11px;
    font-weight: 650;
    text-decoration: none;
}

.auth-link:hover {
    color: var(--legger-red);
    text-decoration: underline;
}

.auth-button-link {
    display: inline-flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.register-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
    color: var(--legger-muted);
    font-size: 11px;
}

.register-cta a {
    color: var(--legger-red);
    font-weight: 700;
    text-decoration: none;
}

.register-cta a:hover {
    color: var(--legger-blue);
    text-decoration: underline;
}

.header-login-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
}

.header-login-link:hover {
    border-color: rgba(254, 84, 74, 0.66);
    background: rgba(254, 84, 74, 0.12);
}

.register-shell {
    position: relative;
    width: min(920px, calc(100% - 40px));
    min-height: calc(100vh - 75px);
    margin: 0 auto;
    padding: 42px 0 52px;
    display: grid;
    align-items: center;
}

.register-card {
    position: relative;
    padding: 34px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: var(--radius-xl);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow);
}

.register-card .panel-header {
    margin-bottom: 24px;
    text-align: center;
}

.register-card h1 {
    max-width: none;
    margin: 0 0 10px;
    color: var(--legger-blue);
    font-size: 28.9px;
    line-height: 1.08;
    letter-spacing: -0.04em;
}

.register-card .panel-header p {
    max-width: 560px;
    margin: 0 auto;
}

.register-stack {
    display: grid;
    gap: 18px;
}

.register-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 18px;
}

.register-full {
    grid-column: 1 / -1;
}

.register-card .login-button {
    width: min(360px, 100%);
    justify-self: center;
    margin-top: 4px;
}

.form-alert {
    padding: 14px 16px;
    border-radius: var(--radius-md);
    font-weight: 650;
    line-height: 1.45;
}

.form-alert-success {
    border: 1px solid rgba(31, 153, 102, 0.22);
    background: #EAF8F1;
    color: #17663F;
}

.form-alert-error {
    border: 1px solid rgba(254, 84, 74, 0.24);
    background: rgba(254, 84, 74, 0.1);
    color: #A53028;
}

.error-message {
    min-height: 16px;
    color: #B92F28;
    font-size: 10.2px;
    line-height: 1.35;
}

.alert,
.result {
    position: relative;
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    font-size: 11.5px;
    line-height: 1.45;
}

.alert strong,
.alert span {
    display: block;
}

.alert-success {
    border: 1px solid rgba(31, 153, 102, 0.22);
    background: #EAF8F1;
    color: #17663F;
}

.alert-warning {
    border: 1px solid rgba(254, 84, 74, 0.24);
    background: rgba(254, 84, 74, 0.1);
    color: #A53028;
}

.result {
    margin: 20px 0 0;
    background: #F2F5F7;
    color: var(--legger-blue);
    overflow: auto;
}

@media (max-width: 880px) {
    .login-site-header {
        min-height: 54px;
        padding: 0 18px;
    }

    .login-header-brand img {
        width: 108px;
    }

    .auth-shell {
        grid-template-columns: 1fr;
        min-height: calc(100vh - 56px);
        padding: 20px 0;
    }

    .auth-card {
        padding: 22px 18px;
    }

    .register-shell {
        width: min(100% - 24px, 100%);
        padding: 28px 0 40px;
    }

    .register-card {
        padding: 26px 20px;
    }

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

@media (max-width: 520px) {
    .auth-shell {
        width: min(100% - 24px, 100%);
    }

    h1 {
        font-size: 30px;
    }

    .lead {
        font-size: 12.5px;
    }

    .auth-logo img {
        width: 126px;
    }
}
