@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:wght@600;700&display=swap');

:root {
    --navy-950: #071c27;
    --navy-900: #0d2b38;
    --navy-700: #174a59;
    --teal: #23869a;
    --gold: #c99b3d;
    --gold-soft: #f4e8c8;
    --cream: #faf8f2;
    --surface: #ffffff;
    --ink: #183641;
    --muted: #6a7c82;
    --border: #dce5e4;
    --danger: #a52f35;
    --success: #17643b;
    --shadow: 0 28px 80px rgba(7, 28, 39, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 10% 12%, rgba(35, 134, 154, .13), transparent 27rem),
        radial-gradient(circle at 92% 30%, rgba(201, 155, 61, .13), transparent 24rem),
        linear-gradient(145deg, #eef5f4 0%, #fbf8f0 55%, #edf3f2 100%);
    color: var(--ink);
    font-family: "DM Sans", "Segoe UI", Arial, sans-serif;
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: linear-gradient(rgba(13, 43, 56, .022) 1px, transparent 1px), linear-gradient(90deg, rgba(13, 43, 56, .022) 1px, transparent 1px);
    background-size: 42px 42px;
    content: "";
    mask-image: linear-gradient(to bottom, black, transparent 85%);
}

.page-header {
    min-height: 82px;
    padding: 13px max(24px, calc((100% - 1120px) / 2));
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    background: linear-gradient(110deg, var(--navy-950), var(--navy-900) 65%, #123e49);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    box-shadow: 0 10px 30px rgba(7, 28, 39, .16);
}

.brand { display: flex; align-items: center; gap: 13px; color: white; text-decoration: none; }
.brand img { width: 51px; height: 51px; padding: 4px; object-fit: contain; border: 1px solid rgba(255,255,255,.14); border-radius: 14px; background: rgba(255,255,255,.08); }
.brand > span { display: grid; gap: 2px; }
.brand strong { font: 700 1.2rem "Playfair Display", Georgia, serif; letter-spacing: .02em; }
.brand small { color: #adc6cc; font-size: .71rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.back-link { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border: 1px solid rgba(255,255,255,.14); border-radius: 999px; color: #f0dca9; text-decoration: none; font-size: .88rem; font-weight: 700; transition: .2s ease; }
.back-link:hover { border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.08); color: white; transform: translateX(-2px); }

.page-shell { width: min(1080px, calc(100% - 32px)); margin: 50px auto 80px; }
.intro { display: flex; align-items: center; justify-content: center; gap: 22px; max-width: 800px; margin: 0 auto 28px; text-align: left; }
.intro-emblem { flex: 0 0 78px; width: 78px; height: 78px; display: grid; place-items: center; border: 1px solid rgba(201,155,61,.35); border-radius: 24px; background: linear-gradient(145deg, #fffdf7, #f3e7c8); color: #9b7427; font-size: 2.25rem; box-shadow: 0 15px 30px rgba(112, 81, 20, .12); transform: rotate(-3deg); }
.eyebrow { margin: 0 0 7px; color: #916a1f; font-size: .74rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1 { margin: 0 0 8px; color: var(--navy-950); font: 700 clamp(2.15rem, 5vw, 3.4rem)/1.05 "Playfair Display", Georgia, serif; letter-spacing: -.025em; }
.intro p:last-child { margin: 0; color: var(--muted); font-size: 1.03rem; }

.form-highlights { max-width: 700px; margin: 0 auto 30px; display: flex; justify-content: center; gap: 8px; }
.form-highlights span { display: flex; align-items: center; gap: 8px; padding: 8px 13px; border: 1px solid rgba(13,43,56,.09); border-radius: 999px; background: rgba(255,255,255,.72); color: var(--muted); font-size: .78rem; font-weight: 700; backdrop-filter: blur(8px); }
.form-highlights b { color: var(--teal); font-size: .7rem; }

.registration-form {
    overflow: hidden;
    padding: clamp(20px, 4.5vw, 48px);
    border: 1px solid rgba(13, 43, 56, .1);
    border-radius: 26px;
    background: rgba(255, 255, 255, .92);
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.form-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 0 0 30px; padding: 0 2px 22px; border-bottom: 1px solid var(--border); }
.form-heading h2 { margin: 0; color: var(--navy-950); font: 700 clamp(1.5rem, 3vw, 2rem) "Playfair Display", Georgia, serif; }
.form-heading > p { margin: 0; color: var(--muted); font-size: .8rem; }
.form-heading > p span { color: var(--danger); }

fieldset { margin: 0 0 24px; padding: clamp(18px, 3vw, 28px); border: 1px solid #e1e9e8; border-radius: 18px; background: linear-gradient(145deg, #fff, #fbfcfb); box-shadow: 0 8px 24px rgba(13,43,56,.035); }
legend { width: auto; margin: 0 0 0 -2px; padding: 0 12px 0 0; color: var(--navy-900); font: 700 1.08rem "Playfair Display", Georgia, serif; }
legend span { display: inline-grid; width: 29px; height: 29px; margin-right: 7px; place-items: center; border-radius: 9px; background: var(--navy-900); color: #f4d996; font: 700 .7rem "DM Sans", sans-serif; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 21px; }
.wide { grid-column: 1 / -1; }
label, .choice > span { display: block; color: #294852; font-size: .86rem; font-weight: 700; }
label > span, .required-note span { color: var(--danger); }
label > input, label > textarea, label > select { margin-top: 8px; }
label > small { display: block; margin-top: 6px; }
.optional-label { display: inline; margin: 0 0 0 7px; color: #7d9095; font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.field-error { display: block; margin-top: 7px; color: var(--danger); font-size: .76rem; font-weight: 700; line-height: 1.4; }
.field-error::before { content: "\26A0"; margin-right: 5px; }
.choice > .field-error { flex: 0 0 100%; margin-top: 2px; }
input, textarea, select {
    width: 100%;
    min-height: 47px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 11px;
    outline: none;
    background: #f9fbfa;
    color: var(--ink);
    font: 500 .94rem "DM Sans", sans-serif;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease, transform .2s ease;
}
input::placeholder, textarea::placeholder { color: #9aa9ad; font-weight: 400; }
textarea { min-height: 90px; resize: vertical; }
input:hover, textarea:hover, select:hover { border-color: #b7c8c9; background: white; }
input:focus, textarea:focus, select:focus { border-color: var(--teal); background: white; box-shadow: 0 0 0 4px rgba(35,134,154,.11); }
input:invalid:not(:placeholder-shown) { border-color: rgba(165,47,53,.55); }
input[readonly] { background: #edf3f2; color: #557078; cursor: not-allowed; }
input[type="file"] { padding: 8px; cursor: pointer; }
input[type="file"]::file-selector-button { margin-right: 11px; padding: 8px 12px; border: 0; border-radius: 7px; background: var(--navy-900); color: white; cursor: pointer; font-weight: 700; }
input[type="checkbox"], input[type="radio"] { width: 18px; min-height: 18px; accent-color: var(--teal); }
small { color: var(--muted); font-size: .75rem; font-weight: 500; }
.photo-upload input { border-style: dashed; border-color: #b8c9c8; background: #f4f8f7; }
.choice { display: flex; align-items: center; flex-wrap: wrap; gap: 11px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: #f8faf9; }
.choice > span { margin-right: auto; }
.choice label { min-width: 82px; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 12px; border: 1px solid #d8e2e1; border-radius: 9px; background: white; cursor: pointer; }

.captcha-section { border-color: rgba(201,155,61,.3); background: linear-gradient(145deg, #fffefa, #fbf6e9); }
.captcha-layout { display: grid; grid-template-columns: auto minmax(240px, 1fr); align-items: end; gap: 24px; margin-top: 20px; }
.captcha-image-wrap { display: flex; align-items: center; gap: 10px; }
.captcha-image-wrap img { width: 240px; height: 76px; border: 1px solid #d8c79e; border-radius: 12px; background: #f5f1e5; object-fit: cover; }
.refresh-captcha { padding: 10px 12px; border: 1px solid #d5c18f; border-radius: 9px; background: white; color: #77591e; cursor: pointer; font-weight: 700; white-space: nowrap; }
.refresh-captcha:hover { background: #f6edd6; }
.captcha-layout input { max-width: 300px; letter-spacing: .16em; text-transform: uppercase; }

.submit-panel { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 30px -48px -48px; padding: 23px 48px; background: linear-gradient(105deg, var(--navy-950), var(--navy-900)); color: white; }
.submit-panel > div { display: grid; gap: 3px; }
.submit-panel > div strong { font: 700 1.05rem "Playfair Display", Georgia, serif; }
.submit-panel > div small { color: #abc2c8; }
.submit-button { display: flex; align-items: center; justify-content: center; gap: 20px; min-width: 230px; margin: 0; padding: 14px 18px; border: 1px solid rgba(255,255,255,.18); border-radius: 11px; background: linear-gradient(135deg, #d4a94e, #b98225); color: #102d37; cursor: pointer; font-size: .92rem; font-weight: 800; box-shadow: 0 10px 24px rgba(0,0,0,.2); transition: transform .2s ease, box-shadow .2s ease; }
.submit-button b { font-size: 1.2rem; }
.submit-button:hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(0,0,0,.27); }

.notice { margin: 0 0 22px; padding: 17px 19px; border-radius: 13px; line-height: 1.55; box-shadow: 0 10px 25px rgba(0,0,0,.05); }
.notice.success { border: 1px solid #a7d5ba; background: #e9f7ef; color: var(--success); }
.notice.error { border: 1px solid #e7b4b4; background: #fff2f2; color: var(--danger); }
.notice ul { margin: 8px 0 0 20px; padding: 0; }
[hidden] { display: none !important; }

@media (max-width: 760px) {
    .page-header { min-height: 70px; }
    .brand img { width: 44px; height: 44px; }
    .page-shell { width: min(100% - 22px, 1080px); margin-top: 32px; }
    .intro { align-items: flex-start; }
    .intro-emblem { flex-basis: 61px; width: 61px; height: 61px; border-radius: 18px; font-size: 1.7rem; }
    .form-highlights { overflow-x: auto; justify-content: flex-start; padding-bottom: 5px; }
    .form-highlights span { flex: 0 0 auto; }
    .form-grid { grid-template-columns: 1fr; }
    .wide { grid-column: auto; }
    .captcha-layout { grid-template-columns: 1fr; }
    .captcha-layout input { max-width: none; }
    .submit-panel { margin: 28px -20px -20px; padding: 22px 20px; }
}

@media (max-width: 560px) {
    .page-header { padding-inline: 15px; }
    .brand small { display: none; }
    .back-link { padding: 8px 10px; font-size: .76rem; }
    .page-shell { margin-bottom: 35px; }
    .intro { display: block; text-align: center; }
    .intro-emblem { margin: 0 auto 16px; }
    .registration-form { padding: 20px; border-radius: 18px; }
    .form-heading { display: block; }
    .form-heading > p { margin-top: 8px; }
    fieldset { padding: 17px 14px; border-radius: 14px; }
    .captcha-image-wrap { align-items: stretch; flex-direction: column; }
    .captcha-image-wrap img { width: 100%; height: auto; min-height: 76px; }
    .submit-panel { align-items: stretch; flex-direction: column; }
    .submit-button { width: 100%; min-width: 0; }
}
