/* ── Reset & Base ────────────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --kantar-blue:    #003087;
    --kantar-teal:    #00a0af;
    --kantar-light:   #e8f4f5;
    --text-dark:      #1a202c;
    --text-mid:       #4a5568;
    --text-light:     #718096;
    --border:         #e2e8f0;
    --success:        #10b981;
    --error:          #ef4444;
    --warning:        #f59e0b;
    --white:          #ffffff;
    --bg:             #f0f4f8;
}

html, body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text-dark);
    font-size: 14px;
    line-height: 1.6;
}

a { color: var(--kantar-teal); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── TOP BAR ─────────────────────────────────────────────────────────────── */
.top-bar {
    background: var(--kantar-blue);
    color: #fff;
    height: 60px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0,0,0,0.25);
}

.top-bar-inner {
    max-width: 1280px;
    margin: 0 auto;
    height: 100%;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand { display: flex; align-items: center; gap: 0.75rem; }

.brand-logo {
    width: 38px; height: 38px;
    background: var(--kantar-teal);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
}

.brand-k {
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    font-style: italic;
    letter-spacing: -1px;
}

.brand-name {
    display: block;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 2px;
    line-height: 1.1;
}

.brand-sub {
    display: block;
    font-size: 0.68rem;
    font-weight: 400;
    color: rgba(255,255,255,0.65);
    letter-spacing: 0.5px;
}

.top-bar-right { display: flex; align-items: center; gap: 1.5rem; }

.secure-badge {
    display: flex; align-items: center; gap: 0.4rem;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.75);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
}

.live-dot {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.9);
}

.dot {
    width: 8px; height: 8px;
    background: var(--success);
    border-radius: 50%;
    display: inline-block;
}

.pulse { animation: pulse 2s infinite; }

@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(16,185,129,0.7); }
    70%  { box-shadow: 0 0 0 8px rgba(16,185,129,0); }
    100% { box-shadow: 0 0 0 0 rgba(16,185,129,0); }
}

.rec-badge {
    background: #ef4444;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    letter-spacing: 0.5px;
    animation: recPulse 1.2s ease-in-out infinite;
}

@keyframes recPulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.5; }
}

.hidden { display: none !important; }

/* ── EXAM RIBBON ─────────────────────────────────────────────────────────── */
.exam-ribbon {
    background: var(--kantar-teal);
    color: #fff;
}

.ribbon-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.6rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0;
}

.ribbon-item {
    display: flex;
    flex-direction: column;
    padding: 0 1.5rem;
}

.ribbon-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: rgba(255,255,255,0.75);
    font-weight: 600;
}

.ribbon-value {
    font-size: 0.82rem;
    font-weight: 600;
    color: #fff;
}

.ribbon-divider {
    width: 1px;
    height: 30px;
    background: rgba(255,255,255,0.3);
    flex-shrink: 0;
}

/* ── PAGE SHELL ──────────────────────────────────────────────────────────── */
.page-shell {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1.5rem;
    min-height: calc(100vh - 60px - 40px - 40px);
    align-items: start;
}

/* ── LEFT INFO PANEL ─────────────────────────────────────────────────────── */
.info-panel {
    position: sticky;
    top: 80px;
}

.info-panel-inner {
    background: var(--white);
    border-radius: 12px;
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.info-section {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.info-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--kantar-blue);
    margin-bottom: 1rem;
}

.info-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.info-list li {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    font-size: 0.82rem;
    color: var(--text-mid);
    line-height: 1.5;
}

.info-bullet {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--kantar-teal);
    background: var(--kantar-light);
    border-radius: 4px;
    padding: 0.1rem 0.35rem;
    flex-shrink: 0;
    margin-top: 2px;
}

/* ── Pattern Table ── */
.pattern-table { font-size: 0.8rem; }

.pattern-row {
    display: grid;
    grid-template-columns: 2fr 0.6fr 0.6fr 0.8fr;
    padding: 0.45rem 0.5rem;
    gap: 0.25rem;
    border-radius: 4px;
    color: var(--text-mid);
}

.pattern-row:nth-child(even) { background: var(--bg); }

.pattern-head {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    color: var(--text-light);
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.25rem;
}

.pattern-total {
    font-weight: 700;
    color: var(--kantar-blue);
    border-top: 1px solid var(--border);
    margin-top: 0.25rem;
    background: var(--kantar-light) !important;
}

.help-box {
    padding: 1rem 1.5rem;
    font-size: 0.8rem;
    color: var(--text-mid);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #fffbeb;
    border-top: 1px solid #fde68a;
}

.help-box svg { color: var(--warning); flex-shrink: 0; }

/* ── STEP CARDS ──────────────────────────────────────────────────────────── */
.step-card {
    background: var(--white);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
    overflow: hidden;
}

.step-card.hidden { display: none; }

.step-card.active {
    animation: slideUp 0.4s ease forwards;
}

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

.card-header {
    background: linear-gradient(135deg, var(--kantar-blue), #1a56b0);
    padding: 1.25rem 2rem;
}

.step-indicator {
    display: flex;
    align-items: center;
    gap: 0;
}

.step-dot {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.6);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.3);
}

.active-step {
    background: var(--kantar-teal);
    color: #fff;
    border-color: var(--kantar-teal);
    box-shadow: 0 0 0 4px rgba(0,160,175,0.3);
}

.done-step {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}

.step-line {
    flex: 1;
    height: 2px;
    background: rgba(255,255,255,0.2);
    max-width: 60px;
}

.active-line { background: var(--success); }

/* ── Card Body ── */
.card-body { padding: 2rem; }

.card-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--kantar-blue);
    margin-bottom: 0.4rem;
}

.card-subtitle {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 1.75rem;
}

/* ── Form ── */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    margin-bottom: 1.1rem;
    position: relative;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-mid);
    margin-bottom: 0.4rem;
}

.required { color: var(--error); }

.form-group input[type="text"],
.form-group input[type="date"],
.form-group input[type="email"] {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 1.5px solid var(--border);
    border-radius: 7px;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--text-dark);
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.form-group input:focus {
    border-color: var(--kantar-teal);
    box-shadow: 0 0 0 3px rgba(0,160,175,0.12);
}

.readonly-field {
    background: #f7fafc !important;
    cursor: not-allowed !important;
    color: var(--text-mid) !important;
    font-weight: 600 !important;
    border-color: var(--border) !important;
}

.field-hint {
    display: block;
    font-size: 0.72rem;
    color: var(--text-light);
    margin-top: 0.3rem;
}

.field-error {
    display: block;
    font-size: 0.75rem;
    color: var(--error);
    margin-top: 0.3rem;
    font-weight: 500;
}

.input-error {
    border-color: var(--error) !important;
    box-shadow: 0 0 0 3px rgba(239,68,68,0.12) !important;
}

/* Terms row */
.terms-row {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin: 1.25rem 0;
    font-size: 0.82rem;
    color: var(--text-mid);
}

.terms-row input[type="checkbox"] { margin-top: 2px; flex-shrink: 0; cursor: pointer; }

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 0.8rem 1.5rem;
    background: linear-gradient(135deg, var(--kantar-blue), #1a56b0);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
    font-family: inherit;
    letter-spacing: 0.3px;
    margin-top: 0.5rem;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #002070, var(--kantar-blue));
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0,48,135,0.35);
}

.btn-primary:disabled {
    background: #a0aec0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    width: 100%;
    padding: 0.8rem 1.5rem;
    background: #fff;
    color: var(--kantar-blue);
    border: 1.5px solid var(--kantar-blue);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    margin-top: 0.5rem;
}

.btn-secondary:hover { background: var(--kantar-light); }

.btn-danger {
    width: 100%;
    padding: 0.8rem 1.5rem;
    background: linear-gradient(135deg, #16a34a, #15803d);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
    font-family: inherit;
    letter-spacing: 0.3px;
    margin-top: 1rem;
}

.btn-danger:hover:not(:disabled) {
    background: linear-gradient(135deg, #15803d, #166534);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(22,163,74,0.4);
}

.btn-danger:disabled {
    background: #a0aec0;
    cursor: not-allowed;
}

/* Trust strip */
.trust-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    font-size: 0.72rem;
    color: var(--text-light);
    flex-wrap: wrap;
}

/* ── System Check ─────────────────────────────────────────────────────────── */
.check-list { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.5rem; }

.check-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.1rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: #fafafa;
    transition: border-color 0.3s, background 0.3s;
}

.check-item.success-item {
    border-color: var(--success);
    background: #f0fdf4;
}

.icon-box {
    width: 34px; height: 34px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}

.icon-box.spinner {
    border: 3px solid #e2e8f0;
    border-top-color: var(--kantar-teal);
    animation: spin 0.9s linear infinite;
}

.icon-box.success {
    background: #d1fae5;
    color: var(--success);
}

.icon-box.success::after { content: '✓'; font-weight: 700; font-size: 1rem; }

@keyframes spin { to { transform: rotate(360deg); } }

.check-text { flex: 1; }
.check-text h3 { font-size: 0.88rem; font-weight: 600; color: var(--text-dark); margin-bottom: 0.15rem; }
.check-text p  { font-size: 0.78rem; color: var(--text-light); }

.check-status {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-light);
    white-space: nowrap;
}

/* Webcam preview */
.webcam-wrap {
    margin-top: 1rem;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.webcam-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--error);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.rec-dot {
    width: 8px; height: 8px;
    background: var(--error);
    border-radius: 50%;
    animation: recPulse 1s infinite;
}

#webcam-preview {
    width: 100%;
    max-width: 280px;
    border-radius: 10px;
    border: 2px solid var(--kantar-teal);
    transform: scaleX(-1);
    box-shadow: 0 4px 14px rgba(0,0,0,0.12);
}

.permission-hint {
    font-size: 0.82rem;
    color: var(--text-mid);
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* ── Rules Grid ───────────────────────────────────────────────────────────── */
.rules-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.rule-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    background: #fafafa;
    text-align: center;
}

.rule-icon { font-size: 1.6rem; margin-bottom: 0.5rem; }

.rule-card p {
    font-size: 0.78rem;
    color: var(--text-mid);
    line-height: 1.5;
}

/* Consent */
.consent-box {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 4px solid var(--warning);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.5rem;
}

.consent-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-mid);
    cursor: pointer;
}

.consent-label input[type="checkbox"] { margin-top: 2px; flex-shrink: 0; }

/* ── FOOTER ──────────────────────────────────────────────────────────────── */
.site-footer {
    background: var(--kantar-blue);
    color: rgba(255,255,255,0.6);
    font-size: 0.75rem;
    height: 40px;
}

.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-links a {
    color: rgba(255,255,255,0.6);
    transition: color 0.2s;
}

.footer-links a:hover { color: #fff; }

/* ── Prank Video ─────────────────────────────────────────────────────────── */
#video-container {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

#video-container.hidden { display: none !important; }

#prank-video { width: 100%; height: 100%; max-height: 100vh; object-fit: contain; }

/* ── Panic Modal ─────────────────────────────────────────────────────────── */
#panic-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.88);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    animation: fadeIn 0.2s ease;
}

#panic-modal.hidden { display: none !important; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.panic-box {
    background: #1a1a2e;
    border: 2px solid #ef4444;
    border-radius: 16px;
    padding: 2.5rem 3rem;
    max-width: 480px;
    text-align: center;
    color: #fff;
    box-shadow: 0 0 80px rgba(239,68,68,0.4);
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%,100% { transform: translateX(0); }
    20%      { transform: translateX(-8px); }
    40%      { transform: translateX(8px); }
    60%      { transform: translateX(-5px); }
    80%      { transform: translateX(5px); }
}

.panic-icon   { font-size: 3rem; margin-bottom: 1rem; }
.panic-box h2 { color: #ef4444; font-size: 1.4rem; margin-bottom: 1rem; }
.panic-box p  { color: #ccc; font-size: 0.9rem; line-height: 1.7; margin-bottom: 0.5rem; }

.panic-sub {
    color: #fff !important;
    font-size: 1rem !important;
    margin-top: 1rem !important;
}

.panic-sub strong { color: #ef4444; font-size: 1.5rem; }

.panic-bar-wrap {
    background: #333;
    border-radius: 99px;
    height: 6px;
    margin-top: 1.5rem;
    overflow: hidden;
}

.panic-bar {
    height: 100%;
    background: linear-gradient(90deg, #ef4444, #f97316);
    width: 100%;
    animation: drainBar 10s linear forwards;
}

@keyframes drainBar { from { width: 100%; } to { width: 0%; } }
