/* =========================================
   GLOBAL VARIABLES & THEMES 
   ========================================= */
:root {
    --bg-gradient: linear-gradient(135deg, #09090e, #1a1a2e, #0f172a);
    --glass-bg: rgba(20, 20, 30, 0.55);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    --text-main: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.75);
    --accent-color: #0A84FF;
    --danger-color: #FF453A;
    --warning-color: #FFD60A;
    --success-color: #32D74B;
    --input-bg: rgba(0, 0, 0, 0.4);
    --hover-bg: rgba(255, 255, 255, 0.08);
}

[data-theme="light"] {
    --bg-gradient: linear-gradient(135deg, #f6f8fd 0%, #e2e8f0 100%); 
    --glass-bg: rgba(255, 255, 255, 0.85); 
    --glass-border: rgba(255, 255, 255, 0.8); 
    --glass-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    --text-main: #1d1d1f; 
    --text-muted: rgba(0, 0, 0, 0.6);
    --input-bg: rgba(255, 255, 255, 0.95);
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }

body {
    background: var(--bg-gradient); color: var(--text-main); 
    height: 100vh; width: 100vw;
    display: flex; justify-content: center; align-items: center; 
    overflow: hidden; 
    transition: background 0.8s ease, color 0.8s ease;
    position: relative;
}

/* =========================================
   INTERACTIVE CURSOR GLOW
   ========================================= */
.cursor-glow {
    position: fixed; top: 0; left: 0; width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(10, 132, 255, 0.15) 0%, transparent 60%);
    border-radius: 50%; pointer-events: none; z-index: 9999;
    transform: translate(-50%, -50%); transition: opacity 0.3s ease;
    mix-blend-mode: screen;
}
[data-theme="light"] .cursor-glow { background: radial-gradient(circle, rgba(10, 132, 255, 0.2) 0%, transparent 60%); mix-blend-mode: multiply; }

/* =========================================
   FOOTER
   ========================================= */
.dev-footer {
    position: fixed; bottom: 15px; width: 100%; text-align: center;
    font-size: 0.75rem; color: var(--text-muted); z-index: 1000;
    letter-spacing: 1px; opacity: 0.6; pointer-events: none;
    text-transform: uppercase; font-weight: 600;
}

/* =========================================
   BACKGROUND AMBIENT ANIMATIONS
   ========================================= */
.ambient-orb {
    position: fixed; border-radius: 50%; filter: blur(100px); opacity: 0.4; z-index: 0;
    animation: orbFloat 12s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}
.orb-1 { width: 45vw; height: 45vw; background: var(--accent-color); top: -10vw; left: -10vw; }
.orb-2 { width: 40vw; height: 40vw; background: #8a2be2; bottom: -5vw; right: -10vw; animation-delay: -6s; }
[data-theme="light"] .ambient-orb { opacity: 0.2; }

@keyframes orbFloat { 0% { transform: translate(0, 0) scale(1); } 100% { transform: translate(10vw, 5vh) scale(1.1); } }

/* =========================================
   SMOOTH ZERO-GRAVITY CONFETTI EFFECTS
   ========================================= */
.explosion-particle {
    position: fixed; 
    bottom: -10vh; left: 50vw; /* Spawn from dead bottom center */
    font-size: 3.5rem; font-weight: 900;
    color: var(--text-main); 
    text-shadow: 0 0 25px var(--accent-color);
    pointer-events: none; z-index: 5;
    opacity: 0;
    /* Super smooth 6 second animation */
    animation: smoothFloat 6s ease-in-out forwards;
}

@keyframes smoothFloat {
    /* 1. Spawn at bottom, hidden */
    0% { transform: translate(0, 0) scale(0.2) rotate(0deg); opacity: 0; }
    /* 2. Rise quickly into the center of the screen, scale up */
    20% { transform: translate(var(--tx), var(--ty)) scale(var(--scale)) rotate(calc(var(--rot) * 0.5)); opacity: 1; }
    /* 3. Hang in the center for a long time, drifting and rotating very slowly */
    80% { transform: translate(calc(var(--tx) + var(--driftX)), calc(var(--ty) + var(--driftY))) scale(var(--scale)) rotate(var(--rot)); opacity: 0.9; }
    /* 4. Slowly fade out while continuing to drift upwards */
    100% { transform: translate(calc(var(--tx) + (var(--driftX) * 2)), calc(var(--ty) - 20vh)) scale(calc(var(--scale) * 0.8)) rotate(calc(var(--rot) * 1.5)); opacity: 0; }
}

/* =========================================
   CONTAINER & 3D PRESENTATION CARDS
   ========================================= */
.container { width: 100%; max-width: 600px; height: 100vh; position: relative; perspective: 1200px; z-index: 10; }
.step-card {
    background: var(--glass-bg); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border); border-radius: 24px;
    box-shadow: var(--glass-shadow); padding: 50px 40px; text-align: center; 
    position: absolute; top: 50%; left: 50%; width: 90%; max-height: 80vh; 
    overflow-y: auto;
    transform: translate(-50%, -40%) scale(0.9) rotateX(-10deg);
    opacity: 0; visibility: hidden; pointer-events: none; 
    transition: all 0.7s cubic-bezier(0.25, 1, 0.2, 1);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.step-card.active { opacity: 1; visibility: visible; pointer-events: auto; transform: translate(-50%, -50%) scale(1) rotateX(0deg); }
.step-card.exiting { transform: translate(-50%, -60%) scale(0.95) rotateX(10deg); opacity: 0; visibility: hidden; pointer-events: none; }
.step-card::-webkit-scrollbar { width: 4px; }
.step-card::-webkit-scrollbar-track { background: transparent; }
.step-card::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 10px; }

/* Typography & Layout */
h2 { font-size: 1.8rem; font-weight: 700; margin-bottom: 20px; letter-spacing: -0.5px; text-align: center; width: 100%; }
p, ul { color: var(--text-muted); line-height: 1.7; font-size: 1rem; margin-bottom: 20px; width: 100%; }
#dynamic-content { text-align: left; width: 100%; }
#dynamic-content ul { padding-left: 20px; }
#dynamic-content li { margin-bottom: 10px; }
.intro-title { font-size: 2.2rem; font-weight: 800; color: var(--accent-color); margin-bottom: 15px; line-height: 1.2; text-transform: uppercase; animation: glowPulse 2s infinite alternate; }
.intro-sub { font-size: 1.2rem; font-weight: 600; color: var(--text-main); letter-spacing: 1px; }

@keyframes glowPulse { 0% { text-shadow: 0 0 10px rgba(10, 132, 255, 0.2); } 100% { text-shadow: 0 0 30px rgba(10, 132, 255, 0.8); } }

/* Buttons & Inputs */
button { cursor: pointer; transition: all 0.3s ease; border-radius: 12px; border: none; outline: none; flex-shrink: 0; }
button:active { transform: scale(0.95); }
button:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; background: #555 !important; box-shadow: none !important; }
.btn-glow { background: var(--accent-color); padding: 0 20px; height: 50px; width: 100%; color: white; font-weight: 700; font-size: 1.05rem; letter-spacing: 0.5px; box-shadow: 0 4px 15px rgba(10, 132, 255, 0.4); margin-top: 15px; }
.btn-glow:hover:not(:disabled) { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(10, 132, 255, 0.6); }
.btn-danger { background: var(--danger-color); box-shadow: 0 4px 15px rgba(255, 69, 58, 0.4); }
.btn-danger:hover:not(:disabled) { box-shadow: 0 8px 25px rgba(255, 69, 58, 0.6); }
.glass-input { background: var(--input-bg); border: 1px solid var(--glass-border); color: var(--text-main); padding: 0 16px; height: 50px; border-radius: 12px; width: 100%; outline: none; font-size: 1.1rem; transition: all 0.3s ease; box-shadow: inset 0 2px 5px rgba(0,0,0,0.05); margin-bottom: 10px; flex-shrink: 0; }
.glass-input:focus { border-color: var(--accent-color); box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.25); transform: translateY(-2px); }
select.glass-input option { background: #24243e; color: white; }
[data-theme="light"] select.glass-input option { background: white; color: black; }

/* Forms Elements */
.bubble-container { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 15px; justify-content: center; }
.role-bubble { background: var(--hover-bg); border: 1px solid var(--accent-color); color: var(--text-main); padding: 8px 15px; border-radius: 20px; font-size: 0.85rem; cursor: pointer; transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.role-bubble:hover { transform: scale(1.1); background: rgba(10, 132, 255, 0.2); }
.role-bubble.selected { background: var(--accent-color); color: white; transform: scale(1.1); box-shadow: 0 0 15px rgba(10, 132, 255, 0.5); border-color: transparent; }
.error-text { color: var(--danger-color); font-size: 0.9rem; display: none; margin-top: -5px; margin-bottom: 10px; font-weight: bold; width: 100%; text-align: left; }
.form-slide { width: 100%; display: none; animation: slideUpFade 0.5s ease forwards; text-align: left; }
.form-slide.active { display: block; }
.form-slide label { display: block; font-size: 0.85rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; margin-bottom: 10px; letter-spacing: 0.5px; }

@keyframes slideUpFade { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.speaking-indicator { font-size: 0.85rem; color: var(--accent-color); font-weight: 600; margin-top: 15px; display: none; align-items: center; justify-content: center; animation: pulseOpacity 1.5s infinite; flex-shrink: 0; }
.speaking-indicator.active { display: flex; }
@keyframes pulseOpacity { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

/* Utility Items */
#warning-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.85); backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px); z-index: 100000; display: none; justify-content: center; align-items: center; flex-direction: column; text-align: center; padding: 20px; }
.warning-box { background: rgba(30, 0, 0, 0.8); border: 2px solid var(--danger-color); padding: 50px; border-radius: 20px; max-width: 500px; box-shadow: 0 0 50px rgba(255, 69, 58, 0.3); animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
@keyframes popIn { 0% { transform: scale(0.8); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
#mini-cam { position: fixed; bottom: 25px; left: 25px; width: 130px; height: 130px; border-radius: 50%; object-fit: cover; border: 3px solid var(--accent-color); box-shadow: 0 0 20px rgba(10, 132, 255, 0.4); z-index: 10000; display: none; transform: scaleX(-1); transition: all 0.5s ease; }
.theme-toggle-btn { position: fixed; bottom: 30px; right: 30px; z-index: 9999; background: var(--glass-bg); backdrop-filter: blur(10px); border: 1px solid var(--glass-border); color: var(--text-main); font-size: 1.4rem; cursor: pointer; padding: 14px; border-radius: 50%; transition: all 0.4s ease; }
.theme-toggle-btn:hover { transform: rotate(20deg) scale(1.15); background: var(--hover-bg); }

/* --- BRAND NEW PERFECT A4 CERTIFICATE (NO BORDERS) --- */
#certificate-template { 
    width: 1122px; height: 793px; background: #ffffff; color: #1a1a1a; 
    padding: 40px; box-sizing: border-box; font-family: 'Georgia', serif; position: relative; 
}
.cert-border { 
    width: 100%; height: 100%; border: none; padding: 15px; /* Border removed entirely */
    box-sizing: border-box; position: relative; 
}
/* Inner before-border has been completely deleted here */
.cert-content { 
    width: 100%; height: 100%; background: #faf9f5; display: flex; flex-direction: column; 
    justify-content: center; align-items: center; padding: 40px 60px; text-align: center; box-sizing: border-box; 
}
.cert-header { margin-bottom: 40px; }
.cert-title { 
    font-size: 48px; font-weight: bold; color: #0f2b46; letter-spacing: 5px; 
    margin: 0; text-transform: uppercase; 
}
.cert-body { 
    flex-grow: 1; display: flex; flex-direction: column; justify-content: center; 
    align-items: center; width: 100%; max-width: 900px; 
}
.cert-text { font-size: 24px; color: #444; margin: 10px 0; }
.cert-name-text { 
    font-size: 55px; color: #1a1a1a; font-weight: bold; margin: 20px 0 5px 0; 
    text-transform: uppercase; border-bottom: 2px solid #c0a16b; padding-bottom: 10px; width: 80%; 
}
.cert-role-text { 
    font-size: 30px; color: #0f2b46; margin: 0 0 30px 0; font-weight: normal; 
    letter-spacing: 2px; text-transform: uppercase; 
}
.paragraph-text { font-size: 22px; line-height: 1.8; margin-bottom: 20px; }
.paragraph-text strong { color: #0f2b46; }
.cert-footer { 
    width: 100%; margin-top: 30px; padding-top: 20px; border-top: 1px solid #ccc; 
}
.hr-declaration { font-size: 20px; color: #0f2b46; font-weight: bold; margin-bottom: 10px; }
.cert-warning { font-size: 14px; color: #777; font-style: italic; max-width: 800px; margin: 0 auto; line-height: 1.5; }