:root {
  --ink: #1a2e28;
  --ink-soft: #2d4a41;
  --parchment: #f7f1e5;
  --parchment-warm: #f1e8d3;
  --gold: #b08d3c;
  --gold-deep: #8a6d2a;
  --gold-light: #d9bf7e;
  --accent: #5a7d6b;
  --error: #a23b2a;
  --border: rgba(26, 46, 40, 0.15);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--parchment);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    radial-gradient(circle at 10% 0%, rgba(176, 141, 60, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 100%, rgba(90, 125, 107, 0.08) 0%, transparent 40%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cg fill='none' stroke='%231a2e28' stroke-opacity='0.03' stroke-width='1'%3E%3Cpath d='M30 0 L60 30 L30 60 L0 30 Z'/%3E%3C/g%3E%3C/svg%3E");
}

.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* ── Header ── */
.hero {
  text-align: center;
  padding: 48px 24px 40px;
  position: relative;
}

.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 24px;
  color: var(--gold);
}

.ornament-line {
  height: 1px;
  width: 80px;
  background: linear-gradient(90deg, transparent, var(--gold) 50%, transparent);
}

.ornament-symbol {
  font-family: 'Amiri', serif;
  font-size: 28px;
  font-weight: 700;
}

.arabic {
  font-family: 'Amiri', serif;
  font-size: 32px;
  color: var(--ink);
  margin-bottom: 12px;
  direction: rtl;
}

h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
  color: var(--ink);
}

.subtitle {
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-deep);
  font-weight: 500;
}

/* ── Intro ── */
.intro {
  background: linear-gradient(135deg, var(--parchment-warm) 0%, var(--parchment) 100%);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 32px 36px;
  margin-bottom: 40px;
  position: relative;
}

.intro::before, .intro::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 1px solid var(--gold);
}
.intro::before { top: 8px; left: 8px; border-right: none; border-bottom: none; }
.intro::after  { bottom: 8px; right: 8px; border-left: none; border-top: none; }

.intro p { margin-bottom: 12px; }
.intro p:last-child { margin-bottom: 0; }

.salam {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-style: italic;
  color: var(--ink-soft);
  margin-bottom: 16px !important;
}

.notes {
  background: rgba(176, 141, 60, 0.08);
  border-left: 3px solid var(--gold);
  padding: 16px 20px;
  margin-top: 20px;
  font-size: 13.5px;
}

.notes ol { margin: 0; padding-left: 18px; }
.notes li { margin-bottom: 6px; }
.notes li:last-child { margin-bottom: 0; }

/* ── Form ── */
form {
  background: #fffdf7;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 40px 44px;
  box-shadow: 0 1px 2px rgba(26, 46, 40, 0.04), 0 12px 40px rgba(26, 46, 40, 0.06);
}

.section { margin-bottom: 36px; }
.section:last-of-type { margin-bottom: 28px; }

.section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.section-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  font-weight: 600;
  color: var(--gold);
  line-height: 1;
  min-width: 40px;
}

.section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 24px;
}
.grid .full { grid-column: 1 / -1; }

@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr; }
  form { padding: 28px 20px; }
  .container { padding: 24px 16px 48px; }
  .intro { padding: 24px; }
}

label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
label .req { color: var(--error); margin-left: 2px; }
label .opt {
  text-transform: none;
  font-weight: 400;
  color: var(--gold-deep);
  letter-spacing: 0;
  font-style: italic;
  margin-left: 6px;
}

input, select, textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--parchment);
  font-family: inherit;
  font-size: 14.5px;
  color: var(--ink);
  transition: all 0.2s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
  background: #fffdf7;
  box-shadow: 0 0 0 3px rgba(176, 141, 60, 0.12);
}

textarea {
  resize: vertical;
  min-height: 90px;
  font-family: inherit;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238a6d2a' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 36px;
}

.hint {
  font-size: 12px;
  color: var(--ink-soft);
  opacity: 0.75;
  margin-top: 5px;
  font-style: italic;
}

/* ── Tempoh card ── */
.tempoh-card {
  background: linear-gradient(135deg, rgba(90, 125, 107, 0.1), rgba(176, 141, 60, 0.08));
  border: 1px dashed var(--accent);
  padding: 16px 20px;
  margin-top: 10px;
  border-radius: 4px;
  font-size: 13.5px;
  display: none;
}
.tempoh-card.visible { display: block; animation: fadeIn 0.4s ease; }
.tempoh-card strong { color: var(--accent); font-weight: 600; }
.tempoh-card .days {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--ink);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Checkbox perakuan ── */
.perakuan {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 20px;
  background: rgba(176, 141, 60, 0.06);
  border: 1px solid var(--border);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s;
}
.perakuan:hover { background: rgba(176, 141, 60, 0.1); }

.perakuan input[type="checkbox"] {
  width: 18px; height: 18px;
  margin-top: 2px;
  accent-color: var(--gold-deep);
  cursor: pointer;
  flex-shrink: 0;
}
.perakuan-text { font-size: 14px; color: var(--ink); line-height: 1.5; }

/* ── Buttons ── */
.actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 32px;
}

button {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 14px 28px;
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  border-radius: 3px;
}

.btn-primary {
  background: var(--ink);
  color: var(--parchment);
  width: 60%;
  min-width: 220px;
  position: relative;
  overflow: hidden;
}
.btn-primary::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(176, 141, 60, 0.2), transparent);
  transition: left 0.6s ease;
}
.btn-primary:hover::before { left: 100%; }
.btn-primary:hover {
  background: var(--ink-soft);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(26, 46, 40, 0.2);
}

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}
.btn-secondary:hover { background: var(--ink); color: var(--parchment); }

.btn-reset {
  background: transparent;
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 4px;
  padding: 4px 8px;
  font-size: 12px;
  letter-spacing: 0.04em;
  font-weight: 400;
  text-transform: none;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ── Success ── */
.success {
  display: none;
  text-align: center;
  padding: 48px 32px;
  background: #fffdf7;
  border: 1px solid var(--border);
  border-radius: 4px;
}
.success.visible { display: block; animation: fadeIn 0.5s ease; }

.success-mark {
  width: 64px; height: 64px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

.success h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 30px;
  font-weight: 500;
  margin-bottom: 12px;
}
.success p { color: var(--ink-soft); margin-bottom: 24px; }

/* ── Success actions — button bersebelahan ── */
.success .actions {
  flex-direction: row;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.success .actions .btn-primary {
  width: auto;
  min-width: 180px;
}

/* ── Validation ── */
.field-error {
  border-color: var(--error) !important;
  background: rgba(162, 59, 42, 0.04) !important;
}
.error-msg { font-size: 12px; color: var(--error); margin-top: 4px; display: none; }
.error-msg.visible { display: block; }

/* ── Footer ── */
footer {
  text-align: center;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--ink-soft);
}
footer strong { color: var(--ink); }
footer .divider { margin: 0 10px; color: var(--gold); }