/* File: style-pengumuman.css */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;0,9..144,700;0,9..144,900;1,9..144,400&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  /* Palette */
  --bg:          #f5f0e8;
  --bg-alt:      #ede7da;
  --surface:     #ffffff;
  --surface-alt: #faf7f2;
  --border:      rgba(180,155,110,0.2);
  --border-mid:  rgba(180,155,110,0.35);

  --gold:        #b8860b;
  --gold-light:  #d4a852;
  --gold-pale:   rgba(184,134,11,0.08);
  --teal:        #0d7377;
  --teal-light:  #14a0a5;
  --teal-pale:   rgba(13,115,119,0.08);
  --rose:        #c0392b;
  --rose-pale:   rgba(192,57,43,0.08);
  --green:       #1a7a4a;
  --green-pale:  rgba(26,122,74,0.08);

  --text-dark:   #1c1610;
  --text-mid:    #5a4e3a;
  --text-muted:  #8c7a5e;
  --text-light:  #b8a48a;

  --radius-card: 28px;
  --radius-btn:  14px;
  --radius-pill: 100px;

  --shadow-card:  0 8px 40px rgba(90,70,30,0.1), 0 2px 8px rgba(90,70,30,0.06);
  --shadow-hover: 0 20px 60px rgba(90,70,30,0.15), 0 4px 16px rgba(90,70,30,0.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg);
  color: var(--text-dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ── DECORATIVE BACKGROUND ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 50% at 5% 5%,   rgba(184,134,11,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 95% 95%,  rgba(13,115,119,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 50% 0%,   rgba(184,134,11,0.04) 0%, transparent 50%);
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, rgba(180,155,110,0.15) 1px, transparent 1px);
  background-size: 28px 28px;
  z-index: 0;
  opacity: 0.5;
}

/* ── FIREWORKS CANVAS ── */
#fireworksCanvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 9999;
  display: none;
  transition: opacity 0.4s ease;
}

/* ── HEADER ── */
header {
  position: relative;
  z-index: 10;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-mid);
  padding: 0 24px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.8), 0 2px 12px rgba(90,70,30,0.06);
}

.header-container {
  max-width: 1100px;
  margin: 0 auto;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-dark);
}

/* ── HEADER ICON — Logo Madrasah ── */
.header-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  /* Subtle background jika logo transparan */
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--border-mid);
  box-shadow: 0 2px 8px rgba(90,70,30,0.1);
}

.header-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

/* Fallback icon jika logo gagal load */
.header-icon i {
  color: var(--gold);
  font-size: 20px;
}

.header-logo h4 {
  font-family: 'Fraunces', serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.2;
}

.header-logo p {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 1px;
}

.header-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--teal);
  background: var(--teal-pale);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(13,115,119,0.2);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── SECTION ── */
.kelulusan-section {
  position: relative;
  z-index: 5;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
}

/* ── CARD ── */
.card-box {
  width: 100%;
  max-width: 520px;
  background: var(--surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-card);
  padding: 40px 32px;
  text-align: center;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  animation: card-in 0.7s cubic-bezier(0.16,1,0.3,1) both;
}
@media (min-width: 640px) {
  .card-box { padding: 48px 44px; }
}

/* Gold line accent top */
.card-box::before {
  content: '';
  position: absolute;
  top: 0; left: 15%; right: 15%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold-light), var(--gold), var(--gold-light), transparent);
  border-radius: 0 0 4px 4px;
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(24px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── CARD HEADER AREA ── */
.card-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}

.card-title {
  font-family: 'Fraunces', serif;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.2;
  margin-bottom: 8px;
}

.card-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 28px;
}

/* Ornament divider */
.ornament {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 auto 28px;
  max-width: 200px;
}
.ornament span { flex: 1; height: 1px; background: var(--border-mid); }
.ornament i    { color: var(--gold-light); font-size: 12px; }

/* ── ERROR ALERT ── */
.text-error {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--rose-pale);
  border: 1px solid rgba(192,57,43,0.25);
  color: var(--rose);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  margin-bottom: 20px;
}

/* ── COUNTDOWN MINI ── */
.countdown-box-mini {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 12px 8px;
  border-radius: 14px;
  text-align: center;
  color: var(--text-dark);
}

/* ── FORM ── */
.form-group {
  text-align: left;
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-mid);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 13px 16px;
  background: var(--surface-alt);
  border: 1px solid var(--border-mid);
  border-radius: 12px;
  color: var(--text-dark);
  font-size: 14px;
  font-family: 'Outfit', sans-serif;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  outline: none;
}
.form-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(184,134,11,0.12);
  background: #fff;
}
.form-input::placeholder { color: var(--text-light); }
.form-input.font-mono    { font-family: 'Courier New', monospace; letter-spacing: 2px; }

/* Submit button */
.btn-submit {
  width: 100%;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  color: white;
  border: none;
  padding: 15px;
  border-radius: var(--radius-btn);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.2s;
  box-shadow: 0 6px 20px rgba(184,134,11,0.3), 0 1px 3px rgba(184,134,11,0.2);
  position: relative;
  overflow: hidden;
}
.btn-submit::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.18) 0%, transparent 60%);
}
.btn-submit:hover  { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(184,134,11,0.35), 0 2px 6px rgba(184,134,11,0.2); }
.btn-submit:active { transform: translateY(0); }

/* Default password hint */
.hint-box {
  margin-top: 16px;
  background: var(--gold-pale);
  border: 1px solid rgba(184,134,11,0.15);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12px;
  color: var(--text-mid);
  text-align: left;
}
.hint-box strong { color: var(--gold); }

/* ── ENVELOPE ── */
.envelope-container {
  perspective: 1200px;
  margin: 8px 0 20px;
}

.envelope {
  width: 240px;
  height: 155px;
  background: linear-gradient(160deg, #fdf8ee 0%, #f0e6cc 100%);
  border-radius: 16px;
  position: relative;
  margin: 0 auto;
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.3s;
  box-shadow: 0 10px 35px rgba(184,134,11,0.2), 0 2px 8px rgba(90,70,30,0.12);
  border: 1px solid rgba(184,134,11,0.2);
}
.envelope:hover {
  transform: translateY(-10px) scale(1.03);
  box-shadow: 0 24px 56px rgba(184,134,11,0.28), 0 4px 14px rgba(90,70,30,0.12);
}
.envelope:hover .envelope-seal { transform: translateX(-50%) rotate(10deg) scale(1.1); }

.envelope-flap {
  width: 0; height: 0;
  border-left:  120px solid transparent;
  border-right: 120px solid transparent;
  border-top:   80px  solid #e0d0aa;
  position: absolute;
  top: 0; left: 0;
  border-radius: 16px 16px 0 0;
}

.envelope-seal {
  width: 48px; height: 48px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
  border-radius: 50%;
  position: absolute;
  top: 54px; left: 50%;
  transform: translateX(-50%);
  display: flex; align-items: center; justify-content: center;
  border: 3px solid #fff;
  font-size: 19px;
  box-shadow: 0 4px 12px rgba(184,134,11,0.35);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

.tap-hint {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-alt);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
}
.tap-hint i { color: var(--gold); }

/* ── RESULT — LULUS ── */
.result-wrapper {
  border: 1px solid rgba(26,122,74,0.2);
  border-radius: 22px;
  padding: 28px 24px;
  background: linear-gradient(160deg, var(--green-pale) 0%, transparent 60%);
  text-align: center;
}

/* ── RESULT ICON — Lingkaran Hijau + Centang Putih ── */
.result-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  box-shadow:
    0 0 0 6px rgba(34,197,94,0.15),
    0 8px 24px rgba(22,163,74,0.35);
  animation: pop-in 0.5s cubic-bezier(0.34,1.56,0.64,1) both;
}

.result-icon {
  width: 72px;
  height: 72px;
  background: #22c55e;        /* hijau */
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}
.result-icon i {
  color: #ffffff;
  font-size: 32px;
}

@keyframes pop-in {
  from { opacity: 0; transform: scale(0.4); }
  to   { opacity: 1; transform: scale(1); }
}

/* Ripple ring animation on result icon */
.result-icon::after {
  content: '';
  position: absolute;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px solid rgba(34,197,94,0.4);
  animation: ripple 1.6s ease-out infinite;
}

@keyframes ripple {
  0%   { transform: scale(1);   opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

.result-title-lulus {
  font-family: 'Fraunces', serif;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 4px;
}

.result-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.status-lulus-tag {
  font-family: 'Fraunces', serif;
  font-size: 2.4rem;
  font-weight: 900;
  color: var(--green);
  letter-spacing: 4px;
  line-height: 1;
  margin-bottom: 6px;
}

/* ── PROFILE BOX ── */
.profile-box {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  margin: 22px 0;
  text-align: left;
}
@media (min-width: 440px) {
  .profile-box { flex-direction: row; align-items: flex-start; }
}

.student-avatar {
  width: 76px;
  height: 100px;
  object-fit: cover;
  border-radius: 12px;
  border: 2px solid var(--border-mid);
  background: var(--bg-alt);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-light);
  flex-shrink: 0;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  flex: 1;
  width: 100%;
}
@media (min-width: 400px) {
  .info-grid { grid-template-columns: 1fr 1fr; }
}

.info-item p-label {
  display: block;
  font-size: 9px;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.info-item p-val {
  display: block;
  font-size: 13px;
  color: var(--text-dark);
  font-weight: 600;
  margin-top: 2px;
  line-height: 1.3;
}

/* ── ACTION BUTTONS ── */
.btn-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
}
@media (min-width: 440px) { .btn-group { flex-direction: row; } }

.btn-skl-action {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px 10px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  text-decoration: none;
  border-radius: 12px;
  color: white;
  border: none;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  letter-spacing: 0.2px;
}
.btn-skl-action:hover { transform: translateY(-2px); }

.bg-print    { background: linear-gradient(135deg,#1c6ca1,#2980b9); box-shadow: 0 4px 14px rgba(28,108,161,0.3); }
.bg-download { background: linear-gradient(135deg, var(--gold), var(--gold-light)); box-shadow: 0 4px 14px rgba(184,134,11,0.3); }
.bg-info     { background: linear-gradient(135deg, var(--teal),#1a9ea5); box-shadow: 0 4px 14px rgba(13,115,119,0.3); }

/* ── RESULT — TIDAK LULUS ── */
.result-wrapper-gagal {
  border: 1px solid rgba(192,57,43,0.2);
  border-radius: 22px;
  padding: 28px 24px;
  background: linear-gradient(160deg, var(--rose-pale) 0%, transparent 60%);
}
.result-icon-gagal {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
  font-size: 22px; color: white;
  box-shadow: 0 6px 20px rgba(192,57,43,0.3);
}
.result-title-gagal {
  font-family: 'Fraunces', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--rose);
  margin-bottom: 10px;
}

/* ── BACK LINK ── */
.link-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  margin-top: 22px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-alt);
  transition: color 0.2s, border-color 0.2s;
}
.link-back:hover { color: var(--gold); border-color: rgba(184,134,11,0.3); }

/* ── LOGOUT LINK ── */
.link-logout {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  margin-top: 18px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-alt);
  transition: color 0.2s, border-color 0.2s;
}
.link-logout:hover { color: var(--rose); border-color: rgba(192,57,43,0.25); }

/* ── VERIFIED BADGE ── */
.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--teal);
  background: var(--teal-pale);
  border: 1px solid rgba(13,115,119,0.2);
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  margin-bottom: 12px;
}

/* ── SECTION TITLE IN CARD ── */
.section-title {
  font-family: 'Fraunces', serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 20px;
}

/* ── MODAL ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(28,22,12,0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center;
  z-index: 200; padding: 20px;
}
.modal-content {
  background: var(--surface);
  border: 1px solid var(--border-mid);
  width: 100%; max-width: 400px;
  padding: 30px 28px;
  border-radius: 24px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(90,70,30,0.2);
  position: relative;
  animation: modal-in 0.35s cubic-bezier(0.16,1,0.3,1) both;
}
@keyframes modal-in {
  from { opacity:0; transform: scale(0.92) translateY(12px); }
  to   { opacity:1; transform: scale(1) translateY(0); }
}
.modal-content::before {
  content:'';
  position: absolute;
  top: 0; left: 20%; right: 20%; height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold-light), transparent);
  border-radius: 0 0 4px 4px;
}
.modal-content h4 {
  font-family: 'Fraunces', serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 4px;
}
.modal-content > p {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.modal-list  { text-align: left; margin: 0 0 20px; display: flex; flex-direction: column; gap: 8px; }
.modal-item  {
  background: var(--surface-alt);
  border: 1px solid var(--border);
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 12.5px;
  color: var(--text-mid);
  line-height: 1.5;
}
.modal-item strong { color: var(--gold); font-weight: 600; }
.btn-modal-close {
  width: 100%; padding: 12px;
  background: var(--bg-alt);
  border: 1px solid var(--border-mid);
  border-radius: 12px;
  color: var(--text-mid);
  font-family: 'Outfit', sans-serif;
  font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background 0.2s;
}
.btn-modal-close:hover { background: var(--border); }

/* ── RESPONSIVE TWEAKS ── */
@media (max-width: 440px) {
  .card-box { padding: 32px 20px; }
  .header-container { height: auto; padding: 14px 0; }
}