:root {
  --navy: #061a3a;
  --navy-dark: #020b1c;
  --blue: #0b3d91;
  --blue-bright: #1457d6;
  --gold: #e8bd43;
  --gold-light: #ffe38a;
  --ink: #10213b;
  --muted: #60708a;
  --paper: #f8fbff;
  --canvas: #020d21;
  --line: #d6deea;
  --green: #138a57;
  --shadow: 0 22px 58px rgba(0, 6, 22, .38);
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 12% 4%, rgba(20,87,214,.42), transparent 28rem),
    radial-gradient(circle at 90% 82%, rgba(11,61,145,.34), transparent 32rem),
    linear-gradient(145deg, #020914 0%, var(--canvas) 50%, #03183d 100%);
  background-attachment: fixed;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid #e4b542; outline-offset: 2px; }
.is-hidden { display: none !important; }

.site-header { width: min(1120px, calc(100% - 48px)); min-height: 88px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--gold-light); text-decoration: none; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; color: var(--gold); }
.brand-mark svg { width: 40px; }
.brand strong, .brand small { display: block; }
.brand strong { letter-spacing: .09em; }
.brand small { margin-top: 2px; color: #c9d6ea; font-size: .7rem; }
.header-label { color: #c9d6ea; font-size: .76rem; font-weight: 700; }

main { width: min(1120px, calc(100% - 48px)); margin: 8px auto 56px; }
.registration-shell { min-height: 680px; display: grid; grid-template-columns: minmax(320px, .82fr) minmax(480px, 1.18fr); overflow: hidden; border: 1px solid rgba(232,189,67,.8); border-radius: 18px; background: var(--paper); box-shadow: var(--shadow); }
.intro-panel { position: relative; overflow: hidden; padding: clamp(40px, 5vw, 62px); display: flex; flex-direction: column; justify-content: space-between; background: linear-gradient(155deg, var(--blue) 0%, var(--navy) 48%, var(--navy-dark) 100%); color: white; }
.intro-panel::before { content: ""; position: absolute; inset: 0; background: linear-gradient(132deg, transparent 0 58%, rgba(20,87,214,.28) 58% 69%, transparent 69%); pointer-events: none; }
.intro-panel::after { content: ""; position: absolute; right: -105px; bottom: -105px; width: 260px; height: 260px; border: 1px solid rgba(234,210,143,.28); border-radius: 50%; }
.intro-panel h1 { position: relative; z-index: 1; max-width: 10.5ch; margin: 0; font-size: clamp(2.45rem, 4.7vw, 4.3rem); line-height: 1; letter-spacing: -.035em; text-wrap: balance; overflow-wrap: normal; }
.intro-panel p { position: relative; z-index: 1; max-width: 36ch; margin: 20px 0 0; color: #d9e5f7; line-height: 1.6; }
.process-list { position: relative; z-index: 1; list-style: none; margin: 46px 0; padding: 0; display: grid; gap: 20px; }
.process-list li { display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: center; }
.process-list li > span { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid rgba(234,210,143,.62); border-radius: 50%; color: var(--gold-light); font-size: .72rem; font-weight: 800; }
.process-list strong, .process-list small { display: block; }
.process-list strong { font-size: .86rem; }
.process-list small { margin-top: 2px; color: #b9cae5; font-size: .72rem; }
.intro-seal { position: relative; z-index: 1; width: 112px; height: 70px; display: flex; align-items: center; gap: 9px; color: var(--gold-light); }
.intro-seal span { width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-weight: 900; }
.intro-seal i { width: 1px; height: 30px; background: rgba(234,210,143,.45); }
.intro-seal b { font-size: .62rem; letter-spacing: .16em; }

.form-panel { min-width: 0; padding: clamp(32px, 5vw, 58px); }
.form-heading { margin-bottom: 28px; display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.form-heading h2, .form-heading p { margin: 0; }
.form-heading h2 { font-size: clamp(1.55rem, 3vw, 2rem); letter-spacing: -.03em; }
.form-heading p { margin-top: 5px; color: var(--muted); font-size: .78rem; }
.form-heading > span { padding-top: 7px; color: var(--blue); font-size: .72rem; font-weight: 800; white-space: nowrap; }
.photo-row { margin-bottom: 24px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.photo-upload { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; }
.photo-upload input { position: absolute; opacity: 0; pointer-events: none; }
.photo-preview { width: 62px; height: 62px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: #e4ecf8; color: var(--blue); }
.photo-preview svg { width: 27px; }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-upload strong, .photo-upload small { display: block; }
.photo-upload strong { font-size: .82rem; }
.photo-upload small { margin-top: 3px; color: var(--muted); font-size: .7rem; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field-wide { grid-column: 1 / -1; }
.field { min-width: 0; display: grid; gap: 7px; }
.field > span { color: #4d4842; font-size: .74rem; font-weight: 750; }
.field input, .field select { width: 100%; height: 46px; padding: 0 12px; border: 1px solid #cfc5b8; border-radius: 9px; background: white; color: var(--ink); }
.field input::placeholder { color: #8c857d; }
.field input:hover, .field select:hover { border-color: #9d9181; }
.field input.is-invalid, .field select.is-invalid { border-color: #ad2735; background: #fff6f6; }
.field-error { color: #a5202e; font-size: .68rem; }
.declaration { margin: 22px 0; display: flex; align-items: flex-start; gap: 10px; color: #514b44; font-size: .78rem; line-height: 1.5; }
.declaration input { width: 17px; height: 17px; margin-top: 1px; accent-color: var(--blue); }
.submit-button { width: 100%; min-height: 50px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; border: 0; border-radius: 10px; background: var(--blue); color: white; font-weight: 800; box-shadow: 0 8px 20px rgba(11,61,145,.25); transition: background-color .18s ease, transform .18s ease, box-shadow .18s ease; }
.submit-button svg { width: 20px; transition: transform .18s ease; }
.submit-button:hover { background: var(--navy); transform: translateY(-1px); box-shadow: 0 11px 24px rgba(6,26,58,.34); }
.submit-button:hover svg { transform: translateX(3px); }
.submit-button:disabled { cursor: wait; opacity: .72; transform: none; }
.privacy-copy { margin: 12px auto 0; color: var(--muted); font-size: .67rem; text-align: center; }

.response-view { min-height: 650px; display: grid; grid-template-columns: minmax(320px, .72fr) minmax(520px, 1.28fr); overflow: hidden; border: 1px solid rgba(232,189,67,.8); border-radius: 18px; background: var(--paper); box-shadow: var(--shadow); animation: reveal-response .6s cubic-bezier(.16,1,.3,1); }
@keyframes reveal-response { from { opacity: .55; transform: translateY(14px); clip-path: inset(0 0 12% 0); } to { opacity: 1; transform: none; clip-path: inset(0); } }
.response-copy { padding: clamp(34px, 5vw, 58px); }
.success-mark { width: 68px; height: 68px; display: grid; place-items: center; border-radius: 50%; background: #dff1e8; color: var(--green); }
.success-mark svg { width: 42px; }
.response-copy h1 { max-width: 9ch; margin: 24px 0 12px; font-size: clamp(2.3rem, 5vw, 4.2rem); line-height: .96; letter-spacing: -.04em; }
.response-copy > p { max-width: 44ch; margin: 0; color: var(--muted); line-height: 1.6; }
.response-details { margin: 28px 0; }
.response-details div { padding: 12px 0; display: grid; grid-template-columns: 1fr auto; gap: 18px; border-top: 1px solid var(--line); }
.response-details dt { color: var(--muted); font-size: .72rem; }
.response-details dd { margin: 0; font-size: .78rem; font-weight: 800; text-align: right; }
.status-chip { padding: 5px 9px; border-radius: 999px; background: #dff1e8; color: var(--green); }
.response-actions { display: flex; gap: 10px; }
.button-primary, .button-secondary { min-height: 46px; padding: 0 17px; border-radius: 10px; font-weight: 800; }
.button-primary { border: 0; background: var(--blue); color: white; }
.button-secondary { border: 1px solid #aebbd0; background: transparent; color: var(--blue); }

.card-area { min-width: 0; padding: clamp(30px, 5vw, 58px); display: flex; flex-direction: column; align-items: center; justify-content: center; background: #dce5f2; }
.card-area > p { align-self: flex-start; margin: 0 0 16px; color: #42526a; font-size: .74rem; font-weight: 800; }
.membership-card { position: relative; width: min(100%, 660px); aspect-ratio: 1.586 / 1; overflow: hidden; border-radius: 16px; background: #fff9e8; color: #281a14; box-shadow: 0 22px 40px rgba(56,31,20,.24); }
.card-rays { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.card-rays::before { content: ""; position: absolute; width: 55%; aspect-ratio: 1; right: -20%; top: -40%; border: 38px solid rgba(20,87,214,.09); border-radius: 50%; }
.card-rays i { position: absolute; right: -18px; top: 28%; width: 90px; height: 18px; background: var(--blue-bright); transform: rotate(-18deg); transform-origin: right center; }
.card-rays i:nth-child(2) { top: 36%; transform: rotate(0); }
.card-rays i:nth-child(3) { top: 44%; transform: rotate(18deg); }
.card-rays i:nth-child(4) { top: 52%; transform: rotate(36deg); }
.card-rays i:nth-child(5) { top: 60%; transform: rotate(54deg); }
.card-head { position: relative; z-index: 1; height: 23%; padding: 4% 5%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 2.3%; background: var(--navy); color: white; }
.card-seal { width: clamp(38px, 6vw, 56px); aspect-ratio: 1; display: grid; place-items: center; border: 1px solid var(--gold-light); border-radius: 50%; color: var(--gold-light); font-size: clamp(.7rem, 1.5vw, 1rem); font-weight: 900; }
.card-head strong, .card-head small { display: block; }
.card-head strong { font-size: clamp(.65rem, 1.55vw, 1.08rem); letter-spacing: .13em; }
.card-head small { margin-top: 3px; color: #c5d5ec; font-size: clamp(.44rem, .8vw, .65rem); letter-spacing: .1em; }
.card-head > b { padding: 5px 7px; background: var(--gold-light); color: var(--navy-dark); font-size: clamp(.42rem, .75vw, .62rem); letter-spacing: .09em; }
.card-body { position: relative; z-index: 1; height: 55%; padding: 5%; display: grid; grid-template-columns: 22% minmax(0, 1fr) 18%; gap: 4%; align-items: center; }
.card-photo { width: 100%; aspect-ratio: .83; display: grid; place-items: center; overflow: hidden; border: 3px solid white; outline: 1px solid #d4c59e; background: #e4ecf8; color: var(--blue); font-size: clamp(1.2rem, 3.5vw, 2.2rem); font-weight: 900; box-shadow: 0 6px 14px rgba(16,33,59,.16); }
.card-photo img { width: 100%; height: 100%; object-fit: cover; }
.card-identity { min-width: 0; }
.card-identity > small { color: var(--blue); font-size: clamp(.4rem, .75vw, .62rem); letter-spacing: .16em; font-weight: 900; }
.card-identity h2 { margin: 4px 0 2px; overflow: hidden; font-size: clamp(.95rem, 2.7vw, 1.8rem); line-height: 1.06; letter-spacing: -.03em; text-overflow: ellipsis; white-space: nowrap; }
.card-identity p { margin: 0 0 9%; overflow: hidden; color: #6c5e52; font-size: clamp(.48rem, 1vw, .72rem); text-overflow: ellipsis; white-space: nowrap; }
.card-identity > span, .card-identity > strong { display: block; }
.card-identity > span { color: #87796d; font-size: clamp(.38rem, .62vw, .54rem); letter-spacing: .1em; }
.card-identity > strong { margin-top: 2px; color: var(--blue); font-size: clamp(.58rem, 1.4vw, .96rem); letter-spacing: .04em; }
.qr-code { justify-self: end; width: 100%; aspect-ratio: 1; padding: 6px; background: white; }
.qr-code img, .qr-code canvas { width: 100% !important; height: 100% !important; }
.card-foot { position: relative; z-index: 1; height: 22%; padding: 0 5%; display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 3%; align-items: center; border-top: 1px solid #dfd0ac; background: #f2e3ba; }
.card-foot span small, .card-foot span strong { display: block; }
.card-foot small { color: #83715f; font-size: clamp(.35rem, .62vw, .5rem); letter-spacing: .08em; }
.card-foot strong { margin-top: 2px; font-size: clamp(.48rem, .85vw, .68rem); }
.card-foot > b { display: flex; align-items: center; gap: 5px; color: var(--green); font-size: clamp(.42rem, .75vw, .62rem); }
.card-foot > b i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.print-link { margin-top: 18px; padding: 8px; border: 0; background: transparent; color: var(--blue); font-weight: 800; }

.toast { position: fixed; z-index: 50; right: 22px; bottom: 22px; max-width: calc(100vw - 44px); padding: 13px 16px; border-radius: 10px; background: var(--ink); color: white; font-size: .8rem; box-shadow: 0 12px 30px rgba(0,0,0,.22); opacity: 0; transform: translateY(14px); pointer-events: none; transition: opacity .2s ease, transform .25s cubic-bezier(.16,1,.3,1); }
.toast.is-visible { opacity: 1; transform: none; }

@media (max-width: 880px) {
  .registration-shell, .response-view { grid-template-columns: 1fr; }
  .intro-panel { min-height: 480px; }
  .intro-panel h1 { max-width: 12ch; }
  .process-list { margin: 36px 0; }
  .card-area { min-height: 520px; }
}

@media (max-width: 600px) {
  .site-header { width: calc(100% - 36px); min-height: 72px; }
  .brand small, .header-label { display: none; }
  main { width: calc(100% - 28px); margin-top: 2px; }
  .registration-shell, .response-view { border-radius: 14px; }
  .intro-panel { min-height: 0; padding: 34px 26px 38px; }
  .intro-panel h1 { max-width: 100%; font-size: clamp(2.25rem, 11vw, 3.25rem); line-height: 1.02; }
  .intro-panel p { margin-top: 16px; }
  .process-list, .intro-seal { display: none; }
  .form-panel { padding: 30px 22px 34px; }
  .form-heading { align-items: flex-end; gap: 14px; }
  .field-grid { grid-template-columns: 1fr; gap: 15px; }
  .field-wide { grid-column: auto; }
  .response-copy { padding: 36px 24px; }
  .response-copy h1 { font-size: 2.8rem; }
  .response-actions { flex-direction: column-reverse; }
  .response-actions button { width: 100%; }
  .card-area { min-height: 440px; padding: 28px 12px; }
  .membership-card { border-radius: 11px; }
}

@media (max-width: 380px) {
  .site-header { width: calc(100% - 28px); }
  main { width: calc(100% - 20px); }
  .intro-panel { padding-inline: 22px; }
  .form-panel { padding-inline: 18px; }
  .form-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .form-heading > span { padding-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media print {
  body * { visibility: hidden !important; }
  #membershipCard, #membershipCard * { visibility: visible !important; }
  #membershipCard { position: fixed !important; inset: 0 auto auto 0 !important; width: 85.6mm !important; height: 53.98mm !important; border-radius: 3mm !important; box-shadow: none !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  @page { size: 85.6mm 53.98mm; margin: 0; }
}
