/* =========================================================================
   CodeNusa Academy — style.css
   Gaya untuk dua halaman: index.html (galeri) & pendaftaran.html (form)
   ========================================================================= */

/* ------------------------------ Variabel ------------------------------ */
:root {
  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f5f7fb;
  --paper: #ffffff;

  --brand: #4f46e5;
  --brand-dark: #3730a3;
  --brand-soft: #eef2ff;
  --accent: #06b6d4;
  --accent-soft: #ecfeff;

  --ok: #047857;
  --ok-soft: #ecfdf5;
  --danger: #dc2626;
  --danger-soft: #fef2f2;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 18px 44px rgba(15, 23, 42, 0.12);

  --sans: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "SFMono-Regular", "JetBrains Mono", Consolas, "Liberation Mono", Menlo, monospace;
}

/* ------------------------------ Reset ------------------------------ */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

h1, h2, h3, h4 { margin: 0 0 12px; line-height: 1.25; letter-spacing: -0.01em; }
p { margin: 0 0 14px; }
a { color: var(--brand); }

.container {
  width: min(1140px, calc(100% - 40px));
  margin: 0 auto;
}

/* ------------------------------ Tombol ------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease,
    box-shadow 0.18s ease, border-color 0.18s ease;
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.28);
}
.btn-primary:hover { background: var(--brand-dark); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.26); }

.btn-light { background: #fff; color: var(--brand-dark); }
.btn-light:hover { background: #f1f5f9; }

.btn-outline {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-soft);
}
.btn-outline:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

.btn-lg { padding: 15px 30px; font-size: 1rem; }

/* ------------------------------ Header ------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--ink);
  box-shadow: 0 2px 16px rgba(15, 23, 42, 0.22);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: #fff;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff;
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 700;
}

.brand-text {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand-text small {
  display: block;
  color: #93a3bb;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.main-nav a {
  padding: 9px 16px;
  border-radius: 999px;
  color: #cbd5e1;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease;
}

.main-nav a:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }

.main-nav a.active {
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff;
}

/* ------------------------------ Hero (galeri) ------------------------------ */
.hero {
  position: relative;
  padding: 76px 0 66px;
  background:
    radial-gradient(900px 420px at 12% -10%, rgba(79, 70, 229, 0.55), transparent 62%),
    radial-gradient(760px 380px at 88% 8%, rgba(6, 182, 212, 0.42), transparent 60%),
    linear-gradient(160deg, #0f172a 0%, #1e293b 100%);
  color: #fff;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 46px 46px;
  pointer-events: none;
}

.hero-inner { position: relative; z-index: 1; max-width: 820px; }

.hero-eyebrow,
.section-eyebrow {
  margin: 0 0 12px;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-eyebrow { color: #7dd3fc; }
.section-eyebrow { color: var(--brand); }

.hero h1 {
  margin-bottom: 16px;
  color: #fff;
  font-size: clamp(2rem, 4.4vw, 3.1rem);
  font-weight: 800;
}

.hero-lead {
  max-width: 680px;
  margin-bottom: 28px;
  color: #cbd5e1;
  font-size: 1.06rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 40px; }

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  max-width: 700px;
}

.stat {
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.07);
}

.stat strong {
  display: block;
  color: #fff;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
}

.stat span { color: #a9b8ce; font-size: 0.84rem; }

/* ------------------------------ Section umum ------------------------------ */
.section { padding: 72px 0; }

.section-head { max-width: 720px; margin-bottom: 40px; }

.section-head h2,
.page-head h1 {
  margin-bottom: 12px;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
}

.section-desc,
.page-lead { color: var(--muted); font-size: 1.02rem; }

/* ------------------------------ Galeri ------------------------------ */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
}

.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: #c7d2fe;
  box-shadow: var(--shadow-lg);
}

.card-media {
  position: relative;
  background: #0f172a;
}

.card-media img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.card:hover .card-media img { transform: scale(1.045); }

.card-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  backdrop-filter: blur(4px);
}

.card-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  padding: 20px 22px 22px;
}

.card-body h3 { font-size: 1.12rem; font-weight: 700; }

.card-body p { color: var(--muted); font-size: 0.94rem; }

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.card-meta span {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 0.75rem;
  font-weight: 600;
}

/* ------------------------------ CTA ------------------------------ */
.cta {
  padding: 56px 0;
  background: linear-gradient(120deg, var(--brand-dark), var(--brand) 55%, var(--accent));
  color: #fff;
}

.cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  flex-wrap: wrap;
}

.cta h2 { margin-bottom: 8px; color: #fff; font-size: 1.6rem; font-weight: 800; }
.cta p { margin: 0; max-width: 620px; color: #e0e7ff; }

/* ------------------------------ Halaman pendaftaran ------------------------------ */
.page-head {
  padding: 56px 0 26px;
  background:
    radial-gradient(700px 300px at 8% -30%, rgba(79, 70, 229, 0.18), transparent 60%),
    linear-gradient(180deg, #fff, var(--bg));
}

.section-form { padding: 34px 0 76px; }

.form-card,
.result-card {
  padding: 34px 36px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.form-card { max-width: 860px; margin: 0 auto; }

.form-group-title {
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--brand-soft);
}

.form-group-title-spaced { margin-top: 34px; }

.form-group-title h2 {
  margin-bottom: 4px;
  color: var(--brand-dark);
  font-size: 1.18rem;
  font-weight: 800;
}

.form-group-title p { margin: 0; color: var(--muted); font-size: 0.9rem; }

/* ------------------------------ Field ------------------------------ */
.field { margin-bottom: 22px; }

.field > label,
.field legend {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 700;
}

.field-group {
  margin: 0 0 22px;
  padding: 0;
  border: 0;
}

.req { color: var(--danger); }

input[type="text"],
input[type="tel"],
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fbfcfe;
  color: var(--ink);
  font: inherit;
  font-size: 0.97rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

input[type="text"]#nik,
input[type="tel"] {
  font-family: var(--mono);
  letter-spacing: 0.04em;
}

textarea { resize: vertical; min-height: 108px; }

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.14);
}

input.is-invalid,
textarea.is-invalid {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.hint { margin: 7px 0 0; color: var(--muted); font-size: 0.82rem; }

.error {
  margin: 7px 0 0;
  color: var(--danger);
  font-size: 0.85rem;
  font-weight: 600;
  min-height: 0;
}

.error:empty { display: none; }

/* --- pilihan (radio & checkbox) --- */
.choice-row { display: flex; flex-wrap: wrap; gap: 12px; }

.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.choice-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 15px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fbfcfe;
  cursor: pointer;
  font-size: 0.93rem;
  font-weight: 600;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.choice-card:hover { border-color: #a5b4fc; background: #fff; }

.choice-card input {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--brand);
  cursor: pointer;
}

.choice-card:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.field-group.is-invalid .choice-card { border-color: #fca5a5; }

/* ------------------------------ Aksi form ------------------------------ */
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.form-note { margin: 16px 0 0; font-size: 0.9rem; font-weight: 600; }
.form-note:empty { display: none; }
.form-note.note-error { color: var(--danger); }
.form-note.note-info { color: var(--ok); }

/* ------------------------------ Kartu hasil ------------------------------ */
.result-section { max-width: 860px; margin: 34px auto 0; }

.result-card { border-top: 5px solid var(--ok); }

.result-head {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.result-head h2 { margin: 10px 0 6px; font-size: 1.3rem; font-weight: 800; }
.result-head p { margin: 0; color: var(--muted); font-size: 0.92rem; }

.result-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result-row {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 10px 20px;
  padding: 14px 0;
  border-bottom: 1px dashed var(--line);
}

.result-row:last-child { border-bottom: 0; }

.result-label { color: var(--muted); font-size: 0.88rem; font-weight: 700; }

.result-value { color: var(--ink); font-size: 0.98rem; word-break: break-word; }

.result-value.mono {
  font-family: var(--mono);
  letter-spacing: 0.04em;
  font-size: 0.95rem;
}

.result-list { margin: 0; padding-left: 20px; }
.result-list li { margin-bottom: 3px; }

.result-count { margin: 8px 0 0; color: var(--muted); font-size: 0.85rem; font-weight: 600; }

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

/* ------------------------------ Footer ------------------------------ */
.site-footer {
  padding: 30px 0;
  background: var(--ink);
  color: #cbd5e1;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.footer-inner p { margin: 0; font-size: 0.88rem; }
.footer-note { color: #7dd3fc; font-family: var(--mono); font-size: 0.82rem; }

/* ------------------------------ Responsif ------------------------------ */
@media (max-width: 1000px) {
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-row { grid-template-columns: 1fr; gap: 4px; }
}

@media (max-width: 700px) {
  .container { width: calc(100% - 28px); }

  .header-inner { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px 0; }
  .main-nav { width: 100%; }
  .main-nav a { flex: 1 1 auto; text-align: center; }

  .hero { padding: 56px 0 48px; }
  .section { padding: 52px 0; }

  .gallery-grid,
  .choice-grid,
  .hero-stats { grid-template-columns: 1fr; }

  .form-card,
  .result-card { padding: 24px 20px; }

  .form-actions .btn,
  .result-actions .btn { width: 100%; }

  .cta-inner { flex-direction: column; align-items: flex-start; }
}

/* ------------------------------ Cetak ------------------------------ */
@media print {
  .site-header,
  .page-head,
  .form-card,
  .cta,
  .site-footer,
  .result-actions { display: none !important; }

  body { background: #fff; }
  .section-form { padding: 0; }
  .result-section { margin: 0; max-width: none; }
  .result-card { border: 0; box-shadow: none; padding: 0; }
}
