:root {
  --primary: #2563eb;
  --primary-700: #1d4ed8;
  --primary-900: #1e3a8a;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;
  --radius: 16px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body.apply-page {
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  background: var(--slate-50);
  color: var(--slate-800);
  -webkit-font-smoothing: antialiased;
}

.hex-bg {
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='52' viewBox='0 0 60 52' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0L60 17.3v17.4L30 52 0 34.7V17.3L30 0z' fill='%23ffffff' fill-opacity='0.06'/%3E%3C/svg%3E");
  background-size: 60px 52px;
}

.apply-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(0, 1.08fr);
}

.apply-intro {
  position: relative;
  background: var(--primary-900);
  color: #fff;
  padding: 40px 44px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
}

.apply-intro a { color: #bfdbfe; }

.apply-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.apply-brand img {
  height: 44px;
  width: auto;
  background: #fff;
  border-radius: 12px;
  padding: 6px;
}

.apply-brand span {
  font-weight: 700;
  font-size: 1.05rem;
}

.apply-kicker {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #bfdbfe;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  padding: 6px 12px;
  width: fit-content;
}

.apply-intro h1 {
  position: relative;
  z-index: 1;
  margin: 18px 0 12px;
  font-size: clamp(1.6rem, 2.4vw, 2.35rem);
  line-height: 1.2;
  font-weight: 800;
}

.apply-intro .lead {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #dbeafe;
  font-size: 0.98rem;
  line-height: 1.65;
  max-width: 36rem;
}

.apply-chips {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.apply-chip {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #eff6ff;
}

.apply-fee {
  position: relative;
  z-index: 1;
  margin-top: 22px;
  background: rgba(15, 23, 42, 0.28);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.55;
  color: #e2e8f0;
}

.apply-contact {
  position: relative;
  z-index: 1;
  font-size: 13px;
  color: #bfdbfe;
}

.apply-contact a {
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.apply-contact a:hover { text-decoration: underline; }

.apply-panel {
  padding: 36px 28px 48px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.apply-card {
  width: 100%;
  max-width: 640px;
  background: #fff;
  border: 1px solid var(--slate-200);
  border-radius: 20px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  padding: 28px 24px 24px;
}

.apply-card h2 {
  margin: 0;
  font-size: 1.35rem;
  color: var(--slate-900);
}

.apply-card .hint {
  margin: 6px 0 22px;
  color: var(--slate-500);
  font-size: 0.9rem;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 14px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field.span-2 { grid-column: 1 / -1; }

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-700);
}

.field label span { color: #ef4444; }

.file-drop {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 12px 14px;
  border: 1.5px dashed #93c5fd;
  border-radius: 14px;
  background: #eff6ff;
  color: var(--slate-800);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.file-drop:hover,
.file-drop.is-drag {
  border-color: var(--primary);
  background: #dbeafe;
}

.file-drop.has-file {
  border-style: solid;
  border-color: #86efac;
  background: #f0fdf4;
}

.file-drop input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  color: inherit;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.file-drop input[type="file"]:invalid,
.file-drop input[type="file"]:required:invalid {
  color: inherit;
  box-shadow: none;
  outline: none;
}

.file-drop-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #fff;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.file-drop.has-file .file-drop-icon { color: #16a34a; }

.file-drop-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.file-drop-title {
  font-size: 14px;
  font-weight: 650;
  color: var(--slate-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-drop-meta {
  font-size: 12px;
  color: var(--slate-500);
}

.file-drop.invalid {
  border-color: var(--primary);
  background: #dbeafe;
  box-shadow: none;
}

.file-drop-btn {
  flex-shrink: 0;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 650;
  padding: 8px 14px;
  border-radius: 999px;
  pointer-events: none;
}

@media (max-width: 640px) {
  .file-drop { flex-wrap: wrap; }
  .file-drop-btn { width: 100%; text-align: center; }
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 11px 12px;
  font: inherit;
  font-size: 14px;
  color: var(--slate-800);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field textarea { min-height: 92px; resize: vertical; }

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.field input.invalid,
.field textarea.invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.field-help {
  color: var(--slate-500);
  font-size: 12px;
}

.apply-agree {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  background: var(--slate-50);
  font-size: 13px;
  line-height: 1.5;
  color: var(--slate-700);
  cursor: pointer;
}

.apply-agree input {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.apply-agree.invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.apply-agree em { color: #ef4444; font-style: normal; }

.apply-note {
  margin: 16px 0 0;
  padding: 12px 14px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  color: var(--primary-900);
  font-size: 12.5px;
  line-height: 1.5;
}

.apply-submit {
  margin-top: 18px;
}

.apply-submit button {
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 13px 16px;
  cursor: pointer;
  transition: background 0.15s;
}

.apply-submit button:hover { background: var(--primary-700); }
.apply-submit button:disabled { opacity: 0.65; cursor: not-allowed; }
.apply-submit button img { height: 18px; }

#error {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 20;
  max-width: 420px;
  margin: 0 auto;
}

.closed-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--primary-900);
}

.closed-card {
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  text-align: center;
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.28);
}

.closed-head {
  background: var(--primary-900);
  color: #fff;
  padding: 32px 24px 24px;
}

.closed-head p {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #bfdbfe;
}

.closed-head h1 {
  margin: 0;
  font-size: 1.4rem;
}

.closed-body { padding: 28px 24px 32px; }
.closed-body p { color: var(--slate-600); line-height: 1.65; margin: 0 0 22px; }

.closed-actions { display: flex; flex-direction: column; gap: 10px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-700); }
.btn-ghost { background: var(--slate-100); color: var(--slate-700); }

@media (max-width: 980px) {
  .apply-shell { grid-template-columns: 1fr; }
  .apply-intro {
    min-height: auto;
    padding: 22px 20px 26px;
  }
  .apply-panel { padding: 20px 16px 36px; }
  .apply-card { padding: 22px 16px; }
}

@media (max-width: 640px) {
  .field-grid { grid-template-columns: 1fr; }
  .field.span-2 { grid-column: auto; }
  .apply-brand span { font-size: 0.95rem; }
  .apply-intro h1 { font-size: 1.45rem; }
}
