body { min-height: 100vh; }

/* BLOBS */
.blob { position: fixed; border-radius: 50%; filter: blur(120px); pointer-events: none; z-index: 0; }
.blob-1 { width: 600px; height: 600px; background: rgba(99,102,241,0.07); top: -200px; right: -150px; }
.blob-2 { width: 500px; height: 500px; background: rgba(6,182,212,0.05); bottom: -100px; left: -100px; }

/* PAGE WRAP */
.page-wrap { padding: 40px 0 60px; position: relative; z-index: 1; }

/* ACTION BAR */
.action-bar {
    background: var(--clr-surface-elevated); backdrop-filter: blur(16px);
    border: 1px solid var(--clr-border); border-radius: 18px;
    padding: 14px 22px;
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
    margin-bottom: 32px;
}
.action-bar-info { display: flex; align-items: center; gap: 10px; }
.action-bar-icon { width: 36px; height: 36px; border-radius: 10px; background: rgba(99,102,241,0.15); display: flex; align-items: center; justify-content: center; color: var(--clr-primary-2); font-size: 1rem; }
.action-bar-text strong { display: block; font-size: 0.88rem; font-weight: 700; color: var(--clr-on-surface); }
.action-bar-text span { font-size: 0.75rem; color: var(--clr-muted); }
.action-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-action {
    display: inline-flex; align-items: center; gap: 7px;
    border-radius: 12px; font-size: 0.82rem; font-weight: 700;
    padding: 9px 18px; cursor: not-allowed; transition: all 0.2s;
    text-decoration: none; border: none; font-family: 'Cairo', sans-serif;
    opacity: 0.35; pointer-events: none;
}
.btn-print    { background: var(--clr-white-hover); border: 1px solid var(--clr-border); color: var(--clr-white-soft); }
.btn-download { background: linear-gradient(135deg, var(--clr-primary), #4f46e5); color: #fff; }
.btn-share    { background: rgba(6,182,212,0.1); border: 1px solid rgba(6,182,212,0.25); color: var(--clr-accent); }
.btn-lock-badge { font-size: 0.75rem; margin-right: 2px; }

/* CERTIFICATE WRAPPER */
.cert-outer { display: flex; justify-content: center; }
.cert-scale-wrapper { width: 100%; display: flex; justify-content: center; overflow: hidden; }
.cert-scale-inner { flex-shrink: 0; transform-origin: top center; }
.cert-shadow-wrap {
    filter: drop-shadow(0 30px 80px rgba(0,0,0,0.7)) drop-shadow(0 0 40px rgba(99,102,241,0.15));
    width: 100%; max-width: 900px;
}

/* CERTIFICATE CARD */
#certificateCard {
    width: 900px; min-height: 636px;
    position: relative; overflow: hidden;
    font-family: 'Cairo', sans-serif;
    background: linear-gradient(160deg, #f8f6f0 0%, #ede8dc 100%);
}

/* FRAME */
.cert-frame { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.cert-frame-inner { position: absolute; inset: 12px; border: 2px solid rgba(37,99,235,0.3); border-radius: 4px; }
.cert-frame-corner { position: absolute; width: 40px; height: 40px; color: #2563eb; }
.cert-frame-corner::before, .cert-frame-corner::after { content: ''; position: absolute; background: currentColor; }
.cert-frame-corner::before { width: 100%; height: 3px; top: 0; left: 0; }
.cert-frame-corner::after  { width: 3px; height: 100%; top: 0; left: 0; }
.cert-frame-corner.tr { top: 8px; right: 8px; transform: rotate(90deg); }
.cert-frame-corner.bl { bottom: 8px; left: 8px; transform: rotate(270deg); }
.cert-frame-corner.br { bottom: 8px; right: 8px; transform: rotate(180deg); }
.cert-frame-corner.tl { top: 8px; left: 8px; }
.cert-bar-top, .cert-bar-bottom { position: absolute; left: 0; right: 0; height: 10px; z-index: 2; background: linear-gradient(90deg,#1e3a5f,#2563eb,#1e3a5f); }
.cert-bar-top { top: 0; }
.cert-bar-bottom { bottom: 0; }
.cert-watermark { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); opacity: 0.05; font-size: 160px; font-weight: 900; pointer-events: none; z-index: 1; white-space: nowrap; user-select: none; color: #1e3a5f; }

/* CERTIFICATE CONTENT (blurred behind overlay) */
.cert-content-blur {
    position: relative; z-index: 3; padding: 40px 60px 36px;
    display: flex; flex-direction: column; align-items: center;
    min-height: 636px; filter: blur(4px); user-select: none; pointer-events: none;
}
.cert-header { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-bottom: 20px; }
.cert-logo { display: flex; align-items: center; gap: 8px; }
.cert-logo-icon { width: 44px; height: 44px; border-radius: 10px; background: #dbeafe; color: #1e3a5f; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; }
.cert-logo-text { font-size: 1.3rem; font-weight: 900; color: #1e3a5f; }
.cert-logo-dot { color: #2563eb; }
.cert-id-badge { font-size: 0.65rem; font-weight: 700; padding: 4px 10px; border-radius: 6px; background: #dbeafe; color: #1e40af; }
.cert-photo-wrap { width: 90px; height: 90px; border-radius: 50%; overflow: hidden; margin: 0 auto 12px; border: 3px solid #2563eb; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; color: #1e3a5f; background: rgba(255,255,255,0.1); }
.cert-title-block { text-align: center; margin-bottom: 16px; }
.cert-main-title {  font-size: 2.4rem; font-weight: 900; letter-spacing: 0.08em; color: #1e3a5f; }
.cert-sub-title  {  font-size: 1rem; font-weight: 400; letter-spacing: 0.18em; color: #3b82f6; }
.cert-ribbon { display: inline-block; padding: 5px 28px; border-radius: 4px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.15em; background: #1e3a5f; color: #fff; margin: 10px 0 6px; }
.cert-name {  font-size: 2.6rem; font-weight: 700; text-align: center; color: #1e3a5f; margin: 4px 0 10px; }
.cert-program-name {  font-size: 1.1rem; font-weight: 600; text-align: center; color: #2563eb; }
.cert-score-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 20px; border-radius: 50px; font-size: 0.8rem; font-weight: 700; background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; margin: 8px 0; }
.cert-date-ribbon { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; padding: 4px 20px; border-radius: 4px; background: #1e3a5f; color: #fff; margin: 6px 0 14px; }
.cert-desc { font-size: 0.72rem; text-align: center; line-height: 1.7; max-width: 580px; margin: 0 auto 16px; color: #475569; }
.cert-footer { display: flex; align-items: flex-end; justify-content: space-between; width: 100%; margin-top: auto; }
.cert-seal { width: 80px; height: 80px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-direction: column; border: 3px solid #b45309; }
.cert-seal-inner { width: 64px; height: 64px; border-radius: 50%; background: #fef3c7; border: 2px solid #d97706; display: flex; align-items: center; justify-content: center; flex-direction: column; }
.cert-seal-icon { font-size: 1.4rem; color: #b45309; }
.cert-seal-text { font-size: 0.45rem; font-weight: 700; color: #92400e; text-align: center; }
.cert-sig-block { text-align: center; }
.cert-sig-line { width: 160px; height: 1px; background: #1e3a5f; margin: 0 auto 4px; }
.cert-sig-name  { font-size: 0.75rem; font-weight: 700; color: #1e3a5f; }
.cert-sig-title { font-size: 0.65rem; color: #475569; }
.cert-sig-img   {  font-style: italic; font-size: 1.4rem; color: #1e3a5f; margin-bottom: 2px; }
.cert-qr-wrap  { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.cert-qr-box   { width: 72px; height: 72px; background: #e2e8f0; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: #94a3b8; font-size: 1.8rem; }
.cert-qr-label { font-size: 0.55rem; font-weight: 700; color: #1e3a5f; opacity: 0.5; }

/* LOCKED OVERLAY */
.cert-locked-overlay {
    position: absolute; inset: 0; z-index: 20;
    background: rgba(7,9,15,0.80);
    backdrop-filter: blur(6px);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 20px; padding: 40px;
}
.lock-icon-wrap {
    width: 88px; height: 88px; border-radius: 50%;
    background: rgba(99,102,241,0.12);
    border: 2px solid rgba(99,102,241,0.35);
    display: flex; align-items: center; justify-content: center;
    font-size: 2.4rem; color: #818cf8;
    animation: lockPulse 2.5s ease-in-out infinite;
}
@keyframes lockPulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(99,102,241,0.35); }
    50%      { box-shadow: 0 0 0 18px rgba(99,102,241,0); }
}
.locked-title {
    font-size: 1.6rem; font-weight: 800; color: #fff; text-align: center;
}
.locked-sub {
    font-size: 0.88rem; color: #94a3b8; text-align: center;
    max-width: 400px; line-height: 1.75;
}

/* PROGRESS */
.progress-wrap { width: 100%; max-width: 420px; }
.progress-label {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 8px;
}
.progress-label span  { font-size: 0.78rem; color: #94a3b8; font-weight: 600; }
.progress-label strong { font-size: 0.92rem; color: #a5b4fc; font-weight: 800; }
.progress-bar-bg {
    height: 10px; border-radius: 99px;
    background: rgba(255,255,255,0.07); overflow: hidden;
}
.progress-bar-fill {
    height: 100%; border-radius: 99px;
    background: linear-gradient(90deg, #6366f1, #818cf8);
    width: 0%; transition: width 1.2s cubic-bezier(0.4,0,0.2,1);
}

/* STEPS */
.steps-list { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 10px; }
.step-item {
    display: flex; align-items: center; gap: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px; padding: 10px 16px;
}
.step-item.done   { border-color: rgba(16,185,129,0.25); background: rgba(16,185,129,0.06); }
.step-item.active { border-color: rgba(99,102,241,0.35); background: rgba(99,102,241,0.08); }
.step-icon {
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem; flex-shrink: 0;
}
.step-item.done   .step-icon { background: rgba(16,185,129,0.15); color: #34d399; }
.step-item.active .step-icon { background: rgba(99,102,241,0.15); color: #818cf8; }
.step-item.pending .step-icon { background: rgba(255,255,255,0.05); color: #475569; }
.step-text strong { display: block; font-size: 0.83rem; font-weight: 700; color: #e2e8f0; }
.step-text span   { font-size: 0.72rem; color: #64748b; }
.step-item.done   .step-text strong { color: #34d399; }
.step-item.active .step-text strong { color: #a5b4fc; }

/* CTA BUTTON */
.btn-complete {
    display: inline-flex; align-items: center; gap: 10px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff; border: none; border-radius: 14px;
    font-size: 1rem; font-weight: 800;
    padding: 14px 36px; cursor: pointer;
    box-shadow: 0 6px 24px rgba(99,102,241,0.4);
    transition: all 0.25s; font-family: 'Cairo', sans-serif;
    text-decoration: none;
}
.btn-complete:hover { transform: translateY(-2px); box-shadow: 0 10px 32px rgba(99,102,241,0.55); color: #fff; }
.btn-complete i { font-size: 1.1rem; }

/* ── LIGHT MODE OVERRIDES ── */
html[data-theme="light"] .action-bar { background: rgba(255,255,255,0.9); box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
html[data-theme="light"] .cert-shadow-wrap { filter: drop-shadow(0 30px 80px rgba(0,0,0,0.15)) drop-shadow(0 0 40px rgba(99,102,241,0.08)); }
html[data-theme="light"] .cert-locked-overlay { background: rgba(255,255,255,0.85); }
html[data-theme="light"] .locked-title { color: #1e293b; }
html[data-theme="light"] .locked-sub { color: #64748b; }
html[data-theme="light"] .progress-bar-bg { background: rgba(0,0,0,0.06); }
html[data-theme="light"] .step-item { background: rgba(0,0,0,0.02); border-color: rgba(0,0,0,0.06); }
html[data-theme="light"] .step-item.pending .step-icon { background: rgba(0,0,0,0.04); }
html[data-theme="light"] .step-text strong { color: #334155; }
html[data-theme="light"] .blob-1 { background: rgba(99,102,241,0.04); }
html[data-theme="light"] .blob-2 { background: rgba(6,182,212,0.03); }

