:root {
  --green: #006600;
  --green-mid: #1a7a1a;
  --green-light: #e8f5e8;
  --red: #bb0000;
  --gold: #c8a951;
  --black: #000000;
  --g900: #1a1a1a;
  --g700: #444;
  --g400: #888;
  --g100: #f5f5f0;
  --white: #fefefe;
  --border: #ddd8cc;
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'DM Sans', sans-serif; background: var(--g100); color: var(--g900); min-height: 100vh; }

/* Header */
header { background: var(--black); color: white; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 12px rgba(0,0,0,0.5); }
.hdr { padding: 14px 48px; display: flex; align-items: center; gap: 20px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.coat { width: 48px; height: 48px; background: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; border: 2px solid var(--gold); }
.hdr-titles h1 { font-family: 'EB Garamond', serif; font-size: 20px; font-weight: 600; line-height: 1.2; }
.hdr-titles p { font-size: 11px; color: rgba(255,255,255,.7); letter-spacing: .06em; text-transform: uppercase; margin-top: 2px; }
nav { background: #111; padding: 0 48px; display: flex; }
nav a { color: rgba(255,255,255,.7); text-decoration: none; font-size: 13px; padding: 10px 18px; display: block; border-bottom: 2px solid transparent; font-weight: 500; transition: all .15s; }
nav a:hover, nav a.active { color: white; border-bottom-color: var(--gold); }

/* Hero */
.hero { background: var(--black); color: white; padding: 44px 48px 36px; border-bottom: 1px solid #333; }
.hero h2 { font-family: 'EB Garamond', serif; font-size: 34px; font-weight: 500; line-height: 1.2; margin-bottom: 8px; }
.hero p { font-size: 14px; color: rgba(255,255,255,.7); max-width: 540px; line-height: 1.6; }

/* Main */
.main { max-width: 800px; margin: 44px auto; padding: 0 24px; }

/* Card */
.card { background: white; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; box-shadow: var(--shadow); }
.card-hdr { padding: 18px 28px; border-bottom: 1px solid var(--border); background: var(--g100); }
.card-hdr h3 { font-family: 'EB Garamond', serif; font-size: 19px; font-weight: 600; }
.card-body { padding: 24px 28px; }

/* Form */
.fg2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.fg { display: flex; flex-direction: column; gap: 5px; }
.fg.full { grid-column: 1/-1; }
label { font-size: 13px; font-weight: 500; color: var(--g700); }
label .req { color: var(--red); }
.form-input, .form-select, .form-textarea {
  padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 6px;
  font-family: 'DM Sans', sans-serif; font-size: 14px; color: var(--g900);
  background: white; transition: border-color .15s, box-shadow .15s; outline: none; width: 100%;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--black); box-shadow: 0 0 0 3px rgba(0,0,0,0.08);
}
.errorlist { list-style: none; margin: 4px 0 0; }
.errorlist li { font-size: 12px; color: var(--red); }
.hint { font-size: 11px; color: var(--g400); }
hr.div { border: none; border-top: 1px solid var(--border); margin: 22px 0; }

/* Buttons */
.btn-row { display: flex; gap: 10px; justify-content: flex-end; }
.btn { padding: 11px 26px; border-radius: 6px; font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 600; cursor: pointer; border: none; transition: all .15s; }
.btn-primary { background: var(--black); color: white; }
.btn-primary:hover { background: #333; }
.btn-secondary { background: white; color: var(--g700); border: 1.5px solid var(--border); }
.btn-secondary:hover { border-color: var(--g400); }

/* Notice */
.notice { background: #fff8e8; border: 1px solid #f0d080; border-radius: 6px; padding: 12px 16px; font-size: 13px; color: var(--g700); line-height: 1.6; margin-bottom: 18px; }
.notice.err { background: #fdf0f0; border-color: #f0b0b0; color: var(--red); }

/* Review modal */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 1000; align-items: center; justify-content: center; }
.modal-overlay.active { display: flex; }
.modal { background: white; border-radius: 8px; width: 100%; max-width: 620px; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.4); }
.modal-hdr { padding: 20px 28px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-hdr h3 { font-family: 'EB Garamond', serif; font-size: 20px; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--g400); line-height: 1; }
.modal-body { padding: 24px 28px; }
.modal-footer { padding: 16px 28px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* Review table */
.rtable { width: 100%; border-collapse: collapse; font-size: 14px; margin-bottom: 14px; }
.rtable tr { border-bottom: 1px solid var(--border); }
.rtable tr:last-child { border: none; }
.rtable th { text-align: left; padding: 9px 12px; color: var(--g400); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; width: 36%; background: var(--g100); }
.rtable td { padding: 9px 12px; color: var(--g900); font-weight: 500; }

/* Subject preview */
.subj { background: var(--g100); border: 1px solid var(--border); border-radius: 6px; padding: 12px 16px; margin: 14px 0; font-size: 13px; color: var(--g700); }
.subj strong { color: var(--black); display: block; margin-bottom: 5px; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }

/* Declaration */
.decl { display: flex; align-items: flex-start; gap: 10px; background: var(--g100); border-radius: 6px; padding: 13px 16px; margin: 14px 0; font-size: 13px; color: var(--g700); line-height: 1.6; cursor: pointer; }
.decl input { width: 16px; height: 16px; margin: 2px 0 0; flex-shrink: 0; cursor: pointer; }

/* Captcha */
.captcha-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.captcha-row img { border: 1.5px solid var(--border); border-radius: 6px; cursor: pointer; height: 50px; }
.captcha-row input { max-width: 160px; letter-spacing: .1em; font-size: 16px; text-transform: uppercase; }

/* Success */
.success-card { background: white; border: 1px solid var(--border); border-radius: 8px; padding: 48px 40px; text-align: center; box-shadow: var(--shadow); }
.success-card h3 { font-family: 'EB Garamond', serif; font-size: 26px; color: var(--black); margin-bottom: 10px; }
.success-card p { font-size: 14px; color: var(--g700); line-height: 1.7; max-width: 460px; margin: 0 auto 18px; }
.refn { background: var(--g100); border: 1px solid var(--border); border-radius: 6px; padding: 11px 22px; font-family: monospace; font-size: 18px; letter-spacing: .1em; color: var(--black); display: inline-block; margin-bottom: 22px; }
.nsteps { background: var(--g100); border-radius: 8px; padding: 18px 22px; text-align: left; max-width: 460px; margin: 0 auto 24px; }
.nsteps h4 { font-size: 11px; font-weight: 700; color: var(--black); margin-bottom: 10px; text-transform: uppercase; letter-spacing: .06em; }
.nsi { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 7px; font-size: 13px; color: var(--g700); }
.nsi-d { width: 18px; height: 18px; background: var(--black); color: white; border-radius: 50%; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; }

/* Status badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.badge-pending { background: #fff3cd; color: #856404; }
.badge-approved { background: #d1e7dd; color: #0a3622; }
.badge-rejected { background: #f8d7da; color: #842029; }
.badge-issued { background: var(--g100); color: var(--black); border: 1px solid var(--border); }
.badge-failed { background: #f8d7da; color: #842029; }

/* Select2 */
.select2-container { width: 100% !important; }
.select2-container--default .select2-selection--single { border: 1.5px solid var(--border); border-radius: 6px; height: 42px; display: flex; align-items: center; font-family: 'DM Sans', sans-serif; font-size: 14px; }
.select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 42px; padding-left: 12px; color: var(--g900); }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 40px; }
.select2-container--default.select2-container--focus .select2-selection--single { border-color: var(--black); box-shadow: 0 0 0 3px rgba(0,0,0,.08); outline: none; }
.select2-dropdown { border: 1.5px solid var(--black); border-radius: 6px; font-family: 'DM Sans', sans-serif; font-size: 14px; }
.select2-search--dropdown .select2-search__field { border: 1px solid var(--border); border-radius: 4px; padding: 6px 10px; font-family: 'DM Sans', sans-serif; }
.select2-container--default .select2-results__option--highlighted[aria-selected] { background-color: var(--black); }

@media (max-width: 768px) {
  .hdr { padding: 12px 16px; }
  nav { padding: 0 16px; }
  .hero { padding: 28px 16px; }
  .main { padding: 0 16px; margin: 24px auto; }
  .fg2 { grid-template-columns: 1fr; }
  .card-body { padding: 18px 16px; }
  .card-hdr { padding: 14px 16px; }
}
