/* =========================================
   GLOBAL VARIABLES: ELITE LIGHT TECH
   ========================================= */
:root {
    --bg-base: #f8fafc;
    --bg-gradient: radial-gradient(circle at 50% 0%, #ffffff 0%, #e2e8f0 100%);
    
    /* Sleek Light Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.8);
    --glass-shadow: 0 25px 50px rgba(15, 23, 42, 0.08), inset 0 2px 0 rgba(255, 255, 255, 1);
    
    /* High-Contrast Typography */
    --text-main: #0f172a;
    --text-muted: #475569;
    
    /* Tech Accents */
    --accent-main: #2563eb; 
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --success-color: #10b981;
    
    /* Inputs */
    --input-bg: rgba(255, 255, 255, 0.9);
    --input-border: rgba(15, 23, 42, 0.1);
    --hover-bg: rgba(241, 245, 249, 1);
}

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

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

/* --- TECH GRID OVERLAY --- */
body::before {
    content: ''; position: absolute; inset: 0;
    background-image: 
        linear-gradient(to right, rgba(15, 23, 42, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(15, 23, 42, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
    -webkit-mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
    pointer-events: none; z-index: 0;
}

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

/* =========================================
   CONTAINER & 3D PRESENTATION CARDS
   ========================================= */
.container { width: 100%; max-width: 650px; height: 100vh; position: relative; perspective: 1500px; z-index: 10; }

.step-card {
    background: var(--glass-bg); 
    backdrop-filter: blur(24px) saturate(150%); 
    -webkit-backdrop-filter: blur(24px) saturate(150%);
    border: 1px solid var(--glass-border); 
    border-radius: 24px;
    box-shadow: var(--glass-shadow); 
    padding: 60px 50px; text-align: center; 
    position: absolute; top: 50%; left: 50%; width: 90%; max-height: 85vh; 
    overflow-y: auto; overflow-x: hidden;
    transform: translate(-50%, -40%) scale(0.95);
    opacity: 0; visibility: hidden; pointer-events: none; 
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 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); }
.step-card.exiting { transform: translate(-50%, -60%) scale(0.95); 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: rgba(15,23,42,0.1); border-radius: 10px; }

/* Dynamic Top Indicator Line */
.step-card::after {
    content: ""; position: absolute; top: 0; left: 10%; right: 10%; height: 4px;
    background: var(--accent-main); border-bottom-left-radius: 4px; border-bottom-right-radius: 4px;
    opacity: 0.8;
}

/* Typography & Layout */
h2 { font-size: 1.8rem; font-weight: 800; margin-bottom: 20px; letter-spacing: -0.5px; color: var(--text-main); width: 100%; text-align: center; }
p, ul { color: var(--text-muted); line-height: 1.7; font-size: 1.05rem; margin-bottom: 24px; width: 100%; font-weight: 500; }
#dynamic-content { text-align: left; width: 100%; }
#dynamic-content ul { padding-left: 20px; }
#dynamic-content li { margin-bottom: 12px; }

.intro-title { font-size: 2.4rem; font-weight: 900; color: var(--text-main); margin-bottom: 15px; line-height: 1.2; text-transform: uppercase; letter-spacing: -1px; }
.intro-sub { font-size: 1.1rem; font-weight: 700; color: var(--accent-main); letter-spacing: 2px; text-transform: uppercase; }

/* --- DYNAMIC, INTERACTIVE MODERN BUTTONS --- */
button { cursor: pointer; border: none; outline: none; flex-shrink: 0; font-family: inherit; }
button:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; box-shadow: none !important; filter: grayscale(100%); }

.btn-glow { 
    background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
    color: var(--text-main); 
    border: 1px solid var(--input-border);
    padding: 16px 32px; border-radius: 16px;
    font-weight: 700; font-size: 1.05rem; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.05), inset 0 2px 0 #ffffff;
    margin-top: 15px; width: 100%; 
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-glow:hover:not(:disabled) { 
    transform: translateY(-4px) scale(1.02); 
    box-shadow: 0 15px 30px rgba(37, 99, 235, 0.15), inset 0 2px 0 #ffffff;
    border-color: rgba(37, 99, 235, 0.3);
    color: var(--accent-main);
}
.btn-glow:active:not(:disabled) { transform: translateY(0px) scale(0.98); }

.btn-danger { color: var(--danger-color); }
.btn-danger:hover:not(:disabled) { border-color: rgba(239, 68, 68, 0.3); color: var(--danger-color); box-shadow: 0 15px 30px rgba(239, 68, 68, 0.15), inset 0 2px 0 #ffffff; }

/* Inputs */
.glass-input { 
    background: var(--input-bg); border: 1px solid var(--input-border); 
    border-radius: 16px; padding: 18px 24px; width: 100%; 
    color: var(--text-main); outline: none; font-size: 1.05rem; font-weight: 500;
    transition: all 0.3s ease; margin-bottom: 12px; box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}
.glass-input:focus { 
    border-color: var(--accent-main); 
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15), inset 0 2px 4px rgba(0,0,0,0.02); 
    transform: translateY(-2px); background: #ffffff;
}
select.glass-input option { color: #000; }

/* Form Elements */
.bubble-container { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; justify-content: center; }
.role-bubble { 
    background: #ffffff; border: 1px solid var(--input-border); 
    color: var(--text-muted); padding: 12px 22px; border-radius: 30px; 
    font-size: 0.95rem; font-weight: 600; cursor: pointer; 
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}
.role-bubble:hover { transform: translateY(-3px); border-color: var(--accent-main); color: var(--accent-main); }
.role-bubble.selected { 
    background: var(--accent-main); color: #ffffff; border-color: var(--accent-main); 
    transform: scale(1.05); box-shadow: 0 10px 20px rgba(37, 99, 235, 0.25); 
}

.error-text { color: var(--danger-color); font-size: 0.9rem; display: none; margin-bottom: 12px; font-weight: 700; width: 100%; text-align: left; }
.form-slide { width: 100%; display: none; animation: slideUpFade 0.4s ease forwards; text-align: left; }
.form-slide.active { display: block; }
.form-slide label { display: block; font-size: 0.85rem; color: var(--accent-main); font-weight: 800; text-transform: uppercase; margin-bottom: 12px; letter-spacing: 0.5px; }

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

/* Speaking Indicator */
.speaking-indicator { font-size: 0.85rem; color: var(--accent-main); font-weight: 700; margin-top: 15px; display: none; align-items: center; justify-content: center; animation: pulseOpacity 1.5s infinite alternate; text-transform: uppercase; letter-spacing: 1px; }
.speaking-indicator.active { display: flex; }
@keyframes pulseOpacity { 0% { opacity: 0.4; } 100% { opacity: 1; } }

/* Utility Items */
#warning-overlay { position: fixed; inset: 0; background: rgba(255,255,255,0.9); 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: #ffffff; border: 1px solid rgba(239, 68, 68, 0.3); padding: 50px; border-radius: 24px; max-width: 500px; box-shadow: 0 25px 50px rgba(239, 68, 68, 0.15); }
#mini-cam { position: fixed; bottom: 30px; left: 30px; width: 140px; height: 140px; border-radius: 50%; object-fit: cover; border: 4px solid #ffffff; box-shadow: 0 15px 35px rgba(0,0,0,0.15); z-index: 10000; display: none; transform: scaleX(-1); }

/* --- A4 CERTIFICATE  --- */
#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; box-sizing: border-box; position: relative; }
.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; }