@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@600;700&display=swap');

/* ============================================================
   ASSURE SUCCESS — PMP / Certificate / Verify styles
   Loaded in addition to style.css on:
   pmp.html, verify.html, generate-certificate.html
   ============================================================ */

/* ── Admin password gate ─────────────────────────────────── */
body.locked { overflow: hidden; }
body.locked .tool-page,
body.locked .navbar,
body.locked .wa-float,
body.locked .cert-stage { display: none !important; }

.auth-gate {
  position: fixed; inset: 0; z-index: 5000;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}
.auth-box {
  background: var(--white); border-radius: 18px; padding: 38px 30px;
  width: 100%; max-width: 380px; text-align: center; box-shadow: var(--shadow-lg);
}
.auth-box img { height: 54px; width: auto; margin: 0 auto 14px; }
.auth-box h2 { color: var(--primary); font-size: 22px; margin-bottom: 6px; }
.auth-box p { color: var(--text-light); font-size: 14px; margin-bottom: 20px; line-height: 1.5; }
.auth-box input {
  width: 100%; padding: 13px 16px; border: 2px solid var(--border);
  border-radius: 10px; font-size: 16px; text-align: center; margin-bottom: 14px;
  font-family: 'Inter', sans-serif;
}
.auth-box input:focus { outline: none; border-color: var(--accent); }
.auth-box .btn { width: 100%; justify-content: center; }
.auth-err { color: #c53030; font-size: 13px; font-weight: 600; margin-top: 12px; min-height: 18px; }

.admin-bar { display: flex; gap: 10px; justify-content: flex-end; margin-bottom: 14px; flex-wrap: wrap; }

/* ── Generic tool page wrapper ───────────────────────────── */
.tool-page {
  padding: 120px 0 80px;
  min-height: 100vh;
  background: var(--light);
}
.tool-card {
  max-width: 620px;
  margin: 0 auto;
  background: var(--white);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 40px;
}
.tool-card h1 { color: var(--primary); font-size: 26px; margin-bottom: 6px; }
.tool-card .sub { color: var(--text-light); font-size: 15px; margin-bottom: 26px; }

.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: 14px; color: var(--primary); margin-bottom: 7px; }
.field input[type="text"],
.field input[type="date"] {
  width: 100%; padding: 13px 16px; border: 2px solid var(--border);
  border-radius: 10px; font-size: 15px; font-family: 'Inter', sans-serif;
  transition: border-color .2s;
}
.field input:focus { outline: none; border-color: var(--accent); }

.code-input {
  width: 100%; padding: 16px 18px; border: 2px solid var(--border);
  border-radius: 12px; font-size: 18px; letter-spacing: 2px; font-weight: 700;
  text-transform: uppercase; font-family: 'Poppins', sans-serif; color: var(--primary);
  text-align: center; transition: border-color .2s;
}
.code-input:focus { outline: none; border-color: var(--accent); }

/* ── Verify result banner ─────────────────────────────────── */
.result { margin-top: 26px; border-radius: 16px; padding: 26px; display: none; }
.result.show { display: block; animation: fadeUp .35s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

.result.valid   { background: rgba(34,197,94,.08);  border: 2px solid #22c55e; }
.result.invalid { background: rgba(229,62,62,.07);  border: 2px solid #e53e3e; }

.result-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.result-icon { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; color: #fff; }
.result.valid   .result-icon { background: #22c55e; }
.result.invalid .result-icon { background: #e53e3e; }
.result-head h3 { font-size: 19px; color: var(--primary); }
.result.invalid .result-head h3 { color: #c53030; }

.result-rows { display: grid; gap: 10px; }
.result-row { display: flex; justify-content: space-between; gap: 16px; padding: 11px 14px; background: var(--white); border-radius: 9px; font-size: 14px; }
.result-row span { color: var(--text-light); }
.result-row strong { color: var(--primary); text-align: right; }
.result-badge { display: inline-block; padding: 4px 12px; border-radius: 50px; font-size: 12px; font-weight: 700; background: #22c55e; color: #fff; }

/* ── Generator output ─────────────────────────────────────── */
.gen-output { margin-top: 28px; display: none; }
.gen-output.show { display: block; }
.gen-codebox {
  background: var(--primary); color: #fff; border-radius: 12px;
  padding: 20px; text-align: center; margin-bottom: 20px;
}
.gen-codebox .lbl { font-size: 12px; text-transform: uppercase; letter-spacing: 2px; opacity: .7; }
.gen-codebox .code { font-family: 'Poppins', sans-serif; font-weight: 800; font-size: 26px; letter-spacing: 3px; margin-top: 6px; }

.snippet {
  background: #0f172a; color: #e2e8f0; border-radius: 10px; padding: 16px;
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 12.5px;
  white-space: pre-wrap; word-break: break-word; line-height: 1.6; margin: 10px 0 14px;
  max-height: 220px; overflow: auto;
}
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.note {
  font-size: 13px; color: var(--text-light); background: var(--light);
  border-left: 4px solid var(--accent); border-radius: 8px; padding: 12px 14px; margin-top: 16px; line-height: 1.6;
}

/* ============================================================
   CERTIFICATE
   ============================================================ */
.cert-stage {
  margin-top: 30px;
  display: flex; justify-content: center;
  overflow-x: auto;
  padding: 4px;
}
.certificate {
  width: 960px; max-width: 100%;
  aspect-ratio: 1.414 / 1;            /* landscape A4-ish */
  background:
    radial-gradient(circle at 20% 0%, rgba(245,166,35,.06), transparent 60%),
    radial-gradient(circle at 100% 100%, rgba(13,36,97,.06), transparent 55%),
    #fffdf7;
  border: 3px solid var(--primary);
  box-shadow: var(--shadow-lg);
  position: relative;
  flex-shrink: 0;
}
.cert-frame {
  position: absolute; inset: 14px;
  border: 2px solid var(--accent);
  border-radius: 4px;
  padding: 4% 7%;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
  overflow: hidden;
}
.cert-watermark {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%) rotate(-22deg);
  font-family: 'Poppins', sans-serif; font-weight: 800; font-size: 86px;
  color: rgba(13,36,97,.045); letter-spacing: 6px; white-space: nowrap; pointer-events: none;
}
.cert-corner { position: absolute; width: 26px; height: 26px; border: 3px solid var(--accent); }
.cert-corner.tl { top: 6px; left: 6px; border-right: 0; border-bottom: 0; }
.cert-corner.tr { top: 6px; right: 6px; border-left: 0; border-bottom: 0; }
.cert-corner.bl { bottom: 6px; left: 6px; border-right: 0; border-top: 0; }
.cert-corner.br { bottom: 6px; right: 6px; border-left: 0; border-top: 0; }

.cert-head { display: flex; align-items: center; gap: 12px; margin-bottom: 2%; z-index: 1; }
.cert-logo { height: 52px; width: auto; }
.cert-brand-name { font-family: 'Poppins', sans-serif; font-weight: 800; font-size: 20px; color: var(--primary); letter-spacing: 1px; line-height: 1.1; }
.cert-brand-tag { font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: var(--accent-dark); font-weight: 600; }

.cert-title { font-family: 'Poppins', sans-serif; font-weight: 700; font-size: clamp(22px, 3.4vw, 34px); color: var(--primary); letter-spacing: 1px; z-index: 1; }
.cert-rule { width: 90px; height: 3px; background: var(--accent); border-radius: 3px; margin: 10px 0 4%; z-index: 1; }

.cert-line { font-size: clamp(12px, 1.5vw, 15px); color: var(--text-light); z-index: 1; }
.cert-name {
  font-family: 'Poppins', sans-serif; font-weight: 800;
  font-size: clamp(26px, 4.4vw, 44px); color: var(--primary);
  margin: 1.5% 0; padding: 0 10px 6px; border-bottom: 2px dotted var(--border);
  z-index: 1; line-height: 1.15;
}
.cert-course {
  font-family: 'Poppins', sans-serif; font-weight: 700;
  font-size: clamp(18px, 2.8vw, 28px); color: var(--accent-dark);
  margin-top: 1.5%; z-index: 1;
}
.cert-course-sub { font-size: clamp(10.5px, 1.35vw, 13.5px); color: var(--text); margin-top: 8px; line-height: 1.55; max-width: 90%; z-index: 1; }

/* Top bar: certificate number (left) + date (right), aligned on one row */
.cert-topbar { width: 100%; display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; z-index: 1; }
.cert-no, .cert-date { line-height: 1.3; }
.cert-date { text-align: right; }
.cert-no span, .cert-date span { display: block; font-size: 9.5px; text-transform: uppercase; letter-spacing: .8px; color: var(--text-light); margin-bottom: 2px; }
.cert-no strong, .cert-date strong { font-family: 'Poppins', sans-serif; font-size: clamp(12px, 1.6vw, 15px); color: var(--primary); letter-spacing: 1px; }

.cert-foot {
  margin-top: auto; width: 100%;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  padding-top: 3%; z-index: 1;
}
.cert-sign { text-align: center; min-width: 170px; }
.cert-sign-name { font-family: 'Dancing Script', cursive; font-weight: 700; font-size: clamp(26px, 3.4vw, 34px); color: var(--primary); line-height: 1; margin-bottom: 2px; }
.cert-sign-line { height: 1px; background: var(--primary); margin-bottom: 6px; }
.cert-sign-role { font-weight: 600; font-size: 13px; color: var(--primary); }
.cert-sign-org { font-size: 11px; color: var(--text-light); }

.cert-seal {
  width: 78px; height: 78px; border-radius: 50%; flex-shrink: 0;
  background: radial-gradient(circle at 30% 30%, var(--accent), var(--accent-dark));
  border: 3px double #fff; box-shadow: 0 0 0 3px var(--accent-dark), var(--shadow);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--primary);
}
.cert-seal-num { font-family: 'Poppins', sans-serif; font-weight: 800; font-size: 26px; line-height: 1; }
.cert-seal-lbl { font-size: 11px; font-weight: 700; letter-spacing: 1px; }

.cert-meta { text-align: right; font-size: 11.5px; min-width: 150px; }
.cert-meta div { margin-bottom: 4px; }
.cert-meta span { display: block; color: var(--text-light); font-size: 10px; text-transform: uppercase; letter-spacing: .5px; }
.cert-meta strong { color: var(--primary); font-size: 12.5px; }

/* ── 35 PDU certificate highlight (PMP page) ──────────────── */
.cert-highlight { padding: 70px 0; background: var(--white); }
.cert-promo {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  border-radius: 20px; padding: 44px; color: #fff;
  display: grid; grid-template-columns: 1.2fr 1fr; gap: 30px; align-items: center;
}
.cert-promo h2 { color: #fff; font-size: 28px; margin-bottom: 12px; }
.cert-promo p { color: rgba(255,255,255,.8); font-size: 15px; line-height: 1.7; margin-bottom: 20px; }
.cert-promo .promo-btns { display: flex; gap: 12px; flex-wrap: wrap; }
.promo-visual { text-align: center; }
.promo-medal { font-size: 92px; line-height: 1; }
.promo-pdus { font-family: 'Poppins', sans-serif; font-weight: 800; font-size: 56px; color: var(--accent); line-height: 1; }
.promo-pdus span { display: block; font-size: 15px; letter-spacing: 3px; color: #fff; font-weight: 600; }

/* ============================================================
   PRINT — only the certificate prints, full landscape page
   ============================================================ */
@media print {
  body * { visibility: hidden !important; }
  .cert-stage, .cert-stage * { visibility: visible !important; }
  .cert-stage {
    position: fixed; inset: 0; margin: 0; padding: 0;
    display: flex; align-items: center; justify-content: center;
    background: #fff;
  }
  .certificate { width: 100%; max-width: 100%; box-shadow: none; }
  @page { size: A4 landscape; margin: 8mm; }
  .wa-float, .navbar, footer { display: none !important; }
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 760px) {
  .cert-promo { grid-template-columns: 1fr; text-align: center; }
  .cert-promo .promo-btns { justify-content: center; }
  .tool-card { padding: 26px; }
  .cert-watermark { font-size: 52px; }
}
