:root {
    color-scheme: light;
    --ege-blue: #0b3d71;
    --ege-blue-dark: #062b52;
    --ege-cyan: #0d7d91;
    --surface: #ffffff;
    --surface-soft: #f5f8fc;
    --input-bg: #ffffff;
    --border: #cbd6e3;
    --text: #17263a;
    --muted: #52667e;
    --danger: #a61b2b;
    --danger-soft: #fff0f1;
    --danger-border: #d6818c;
    --danger-text: #7d1422;
    --success: #17653a;
    --success-soft: #eaf8f0;
    --success-border: #76b994;
    --success-text: #104b2b;
    --info-bg: #eef6ff;
    --info-border: #9abfe5;
    --info-text: #163f68;
    --warning-bg: #fff8df;
    --warning-border: #e2c66b;
    --warning-text: #59480f;
    --page-bg: radial-gradient(circle at 8% 4%, rgba(13, 125, 145, .15), transparent 30rem), linear-gradient(145deg, #eef4fa 0%, #f8fbfd 52%, #e7f0f7 100%);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --ege-blue: #72b7f4;
    --ege-blue-dark: #071b31;
    --ege-cyan: #55c8d5;
    --surface: #0f1929;
    --surface-soft: #131f31;
    --input-bg: #111e31;
    --border: #3a4c66;
    --text: #edf4ff;
    --muted: #b6c5d8;
    --danger: #ff8292;
    --danger-soft: #391c27;
    --danger-border: #d85f73;
    --danger-text: #ffd6dc;
    --success: #7be0a8;
    --success-soft: #143324;
    --success-border: #4ba876;
    --success-text: #c9f8dc;
    --info-bg: #102a43;
    --info-border: #386b98;
    --info-text: #d7eaff;
    --warning-bg: #332b14;
    --warning-border: #806f32;
    --warning-text: #f9e7a8;
    --page-bg: radial-gradient(circle at 8% 4%, rgba(30, 176, 195, .13), transparent 30rem), linear-gradient(145deg, #07111f 0%, #0b1524 52%, #091827 100%);
}

* { box-sizing: border-box; }

body {
    background: var(--page-bg);
    color: var(--text);
    margin: 0;
    min-height: 100vh;
}

button, input, select, textarea { font: inherit; }

.page-shell {
    display: grid;
    min-height: 100vh;
    padding: 20px 12px;
    place-items: start center;
}

.form-card {
    background: var(--surface);
    border: 1px solid rgba(11, 61, 113, .16);
    border-radius: 18px;
    box-shadow: 0 18px 60px rgba(15, 47, 82, .14);
    max-width: 920px;
    overflow: hidden;
    width: 100%;
}

.page-header {
    background: linear-gradient(135deg, var(--ege-blue-dark), var(--ege-blue));
    color: #fff;
    padding: 30px 24px 26px;
    position: relative;
    text-align: center;
}

.theme-toggle {
    align-items: center;
    background: rgba(255, 255, 255, .13);
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 999px;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    font-size: .83rem;
    font-weight: 700;
    gap: 7px;
    min-height: 38px;
    padding: 7px 12px;
    position: absolute;
    right: 16px;
    top: 16px;
}
.theme-toggle:hover { background: rgba(255, 255, 255, .22); }
.theme-toggle__icon { font-size: 1.05rem; line-height: 1; }

.ege-logo {
    background: #fff;
    border-radius: 12px;
    height: 72px;
    max-width: 210px;
    object-fit: contain;
    padding: 8px 12px;
}

.eyebrow {
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .14em;
    margin: 18px 0 8px;
    text-transform: uppercase;
}

h1 {
    font-size: clamp(1.55rem, 5vw, 2.25rem);
    line-height: 1.18;
    margin: 0;
}

.intro {
    color: #e1edf8;
    line-height: 1.6;
    margin: 14px auto 0;
    max-width: 680px;
}

.visitor-form, .message-region, .form-card > .notice { margin-left: 18px; margin-right: 18px; }

.notice {
    border: 1px solid;
    border-radius: 10px;
    display: grid;
    gap: 5px;
    line-height: 1.5;
    margin-bottom: 18px;
    margin-top: 18px;
    padding: 14px 16px;
}

.notice-info { background: var(--info-bg); border-color: var(--info-border); color: var(--info-text); }
.notice-warning { background: var(--warning-bg); border-color: var(--warning-border); color: var(--warning-text); }
.notice-error { background: var(--danger-soft); border-color: var(--danger-border); color: var(--danger-text); }
.notice-success { background: var(--success-soft); border-color: var(--success-border); color: var(--success-text); }
.notice-error strong, .notice-error b, .notice-success strong, .notice-success b { color: inherit; }

.visitor-form { padding-bottom: 24px; }

fieldset {
    border: 1px solid var(--border);
    border-radius: 12px;
    margin: 20px 0 0;
    padding: 18px;
}

legend {
    color: var(--ege-blue);
    font-size: 1.05rem;
    font-weight: 750;
    padding: 0 8px;
}

.form-grid { display: grid; gap: 18px; }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.full-width { grid-column: 1 / -1; }

.field { min-width: 0; }

label {
    display: inline-block;
    font-weight: 650;
    line-height: 1.35;
    margin-bottom: 7px;
}

label span[aria-hidden="true"] { color: var(--danger); }

input, select, textarea {
    background: var(--input-bg);
    border: 1px solid #9cadbf;
    border-radius: 8px;
    color: var(--text);
    min-height: 46px;
    outline: none;
    padding: 10px 12px;
    transition: border-color .15s, box-shadow .15s;
    width: 100%;
}

textarea { min-height: 104px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible {
    border-color: var(--ege-cyan);
    box-shadow: 0 0 0 4px rgba(13, 125, 145, .18);
}
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger); }

.field-help, .field-error { font-size: .83rem; line-height: 1.45; margin: 6px 0 0; }
.field-help { color: var(--muted); }
.field-error { color: var(--danger); font-weight: 650; }
.field-help--important {
    background: var(--warning-bg);
    border-left: 3px solid var(--warning-border);
    border-radius: 5px;
    color: var(--warning-text);
    margin-top: 8px;
    padding: 8px 10px;
}

.legal-consent {
    background: var(--warning-bg);
    border: 1px solid var(--warning-border);
    border-radius: 9px;
    color: var(--warning-text);
    line-height: 1.5;
    padding: 14px;
}
.legal-consent p { margin: 7px 0 0; }

.check-row {
    align-items: flex-start;
    cursor: pointer;
    display: flex;
    gap: 10px;
    margin: 16px 0;
}
.check-row input { flex: 0 0 22px; height: 22px; margin: 0; min-height: 22px; width: 22px; }

.captcha-row {
    align-items: end;
    display: grid;
    gap: 18px;
    grid-template-columns: 1fr minmax(100px, 180px);
}
.captcha-question { color: var(--ege-blue); font-size: 1.35rem; font-weight: 800; margin: 3px 0; }

.submit-button {
    background: linear-gradient(135deg, var(--ege-blue), #116aa1);
    border: 0;
    border-radius: 9px;
    color: #fff;
    cursor: pointer;
    display: block;
    font-weight: 750;
    margin-top: 22px;
    min-height: 50px;
    padding: 12px 20px;
    width: 100%;
}
.submit-button:hover { filter: brightness(1.08); }
.submit-button:disabled { cursor: wait; opacity: .7; }

.security-note { color: var(--muted); font-size: .82rem; line-height: 1.5; text-align: center; }

footer {
    background: var(--surface-soft);
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: .85rem;
    padding: 18px;
    text-align: center;
}

.honeypot { height: 1px; left: -10000px; overflow: hidden; position: absolute; top: auto; width: 1px; }
.is-hidden { display: none; }

@media (max-width: 680px) {
    .page-shell { padding: 0; }
    .form-card { border: 0; border-radius: 0; min-height: 100vh; }
    .page-header { padding: 24px 18px; }
    .theme-toggle { margin: 0 0 18px; position: static; }
    .visitor-form, .message-region, .form-card > .notice { margin-left: 12px; margin-right: 12px; }
    fieldset { padding: 15px 12px; }
    .two-columns, .captcha-row { grid-template-columns: 1fr; }
    .captcha-row input { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
