:root {
    font-family: system-ui, sans-serif;
    background: #171021;
    color-scheme: light;
    --cream: #faf0e4;
    --plum: #541638;
    --violet: #6030b1;
    --violet-hover: #51269d;
    --focus: #6a35c2;
    --panel-highlight: #fcf3e8;
    --surface: #fffaf3;
    --inset: #f0e2ec;
    --line: #e5ccda;
    --muted: #794563;
    --input-line: #713252;
    --action-line: #c6a6e3;
    --action-bg: #eee0f8;
    --action-text: #55238f;
    --action-hover: #e6d3f4;
    --success-line: #c1d9ca;
    --success-bg: #eaf3ec;
    --success-text: #234b36;
    --error-line: #e6bbc8;
    --error-bg: #f6e1e6;
    --error-text: #8b2046;
    --error-hover: #f4dae4;
    --page-glow-top: #ded0f1;
    --page-glow-bottom: #e8d9ef;
    --page-base: #f5edf6;
    --card-shadow: #41225833;
    --card-edge: #c3a3db;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --cream: #201728;
    --plum: #fbecf6;
    --violet: #7744c2;
    --violet-hover: #6837af;
    --focus: #d3a9ff;
    --panel-highlight: #291d34;
    --surface: #2b2036;
    --inset: #372642;
    --line: #57405f;
    --muted: #d2b7ce;
    --input-line: #906f98;
    --action-line: #785699;
    --action-bg: #3c2853;
    --action-text: #eedcff;
    --action-hover: #503568;
    --success-line: #48755e;
    --success-bg: #203d31;
    --success-text: #b7ead0;
    --error-line: #996078;
    --error-bg: #4a2336;
    --error-text: #ffc0d5;
    --error-hover: #633148;
    --page-glow-top: #372055;
    --page-glow-bottom: #2b183e;
    --page-base: #120d19;
    --card-shadow: #0e071fb3;
    --card-edge: #9255df;
}

.form-page {
    --page-gutter: clamp(10px, 2.5vw, 36px);

    display: grid;
    grid-template-columns: minmax(0, 1fr);
    place-items: start center;
    box-sizing: border-box;
    min-height: 100vh;
    min-height: 100svh;
    margin: 0;
    padding: 60px var(--page-gutter) var(--page-gutter);
    color: var(--plum);
    background:
        radial-gradient(ellipse at 50% 20%, var(--page-glow-top) 0%, transparent 52%),
        radial-gradient(ellipse at 50% 87%, var(--page-glow-bottom) 0%, transparent 52%),
        var(--page-base);
}

.form-card {
    box-sizing: border-box;
    width: min(100%, 106rem);
    min-height: calc(100svh - 60px - var(--page-gutter));
    overflow: hidden;
    border: 1px solid var(--card-edge);
    border-radius: clamp(18px, 2vw, 28px);
    background: var(--cream);
    box-shadow: 0 20px 60px var(--card-shadow);
}

.form-hero {
    position: relative;
    aspect-ratio: 2.3;
    background: #291d34;
}

.form-hero img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.form-hero-compact {
    aspect-ratio: auto;
    height: clamp(88px, 12vw, 176px);
}

.form-hero-compact img {
    object-position: center 58%;
}

.form-brand {
    position: absolute;
    inset-block-start: clamp(16px, 4vw, 26px);
    inset-inline-start: clamp(20px, 5vw, 34px);
    color: #faf0e4;
    font-size: clamp(1.7rem, 5vw, 2.5rem);
    font-weight: 850;
    letter-spacing: 0.02em;
    line-height: 1;
}

.form-panel {
    padding: clamp(16px, 3.2vw, 48px);
    background: linear-gradient(145deg, var(--panel-highlight), var(--cream));
}

.form-panel h1 {
    margin: 0 0 clamp(20px, 5vw, 30px);
    font-size: clamp(1.65rem, 5.2vw, 2.55rem);
    font-weight: 850;
    letter-spacing: -0.035em;
    line-height: 1.12;
}

.form-field + .form-field {
    margin-top: 20px;
}

.form-field label {
    display: block;
    margin-bottom: 7px;
    font-size: 0.96rem;
    font-weight: 750;
}

.form-field :is(input, select) {
    box-sizing: border-box;
    width: 100%;
    min-height: 50px;
    padding: 10px 13px;
    border: 1px solid var(--input-line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--plum);
    font: inherit;
}

.form-page :is(input, select, button):focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
}

.form-submit {
    width: 100%;
    min-height: 52px;
    margin-top: clamp(22px, 5vw, 30px);
    padding: 10px 16px;
    border: 0;
    border-radius: 11px;
    background: var(--violet);
    color: #fff;
    font: inherit;
    font-size: 1.15rem;
    font-weight: 800;
    cursor: pointer;
}

.form-submit:hover {
    background: var(--violet-hover);
}

.form-errors {
    margin-bottom: 18px;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--error-bg);
}

.form-panel .errorlist {
    margin: 7px 0 0;
    padding: 0;
    color: var(--error-text);
    font-size: 0.9rem;
    list-style: none;
}

.form-errors .errorlist {
    margin: 0;
}

.form-success {
    margin: 0 0 16px;
    padding: 11px 13px;
    border: 1px solid var(--success-line);
    border-radius: 9px;
    background: var(--success-bg);
    color: var(--success-text);
}

.theme-toggle {
    position: absolute;
    z-index: 1;
    inset-block-start: 8px;
    inset-inline-end: var(--page-gutter);
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--action-line);
    border-radius: 999px;
    background: var(--action-bg);
    color: var(--action-text);
    font: inherit;
    font-size: 0.875rem;
    cursor: pointer;
}

.theme-toggle:hover {
    background: var(--action-hover);
}
