/* OMODA | JAECOO — neon cyberpunk theme, mobile-first */

:root {
    --neon-cyan: #00e5ff;
    --neon-magenta: #ff2e97;
    --neon-purple: #7c4dff;
    --neon-green: #39ff14;

    --bg-dark: #04040d;
    --glass-bg: rgba(14, 14, 34, 0.55);
    --glass-bg-strong: rgba(10, 10, 26, 0.8);
    --glass-border: rgba(255, 255, 255, 0.14);

    --text-primary: #f5f7ff;
    --text-secondary: rgba(245, 247, 255, 0.68);

    --radius-lg: 22px;
    --radius-md: 14px;
    --radius-sm: 9px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background: var(--bg-dark);
    color: var(--text-primary);
    font-family: 'Exo', sans-serif;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* body must establish its own stacking context, otherwise its solid
   background (a normal, unpositioned box) paints above the fixed,
   negative-z-index .app-bg layer below and hides it completely. */
body {
    position: relative;
    z-index: 0;
}

.app-bg {
    position: fixed;
    inset: 0;
    background: url('../images/background.jpg') center center / cover no-repeat;
    z-index: -2;
}

.app-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(4,4,13,0.1) 0%, rgba(4,4,13,0.25) 55%, rgba(4,4,13,0.6) 100%);
    z-index: -1;
}

.app-shell {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    max-width: 520px;
    margin: 0 auto;
    padding: 24px 20px 40px;
    position: relative;
}

a { color: inherit; text-decoration: none; }

/* --- Logo --- */
.brand-logo { display: block; margin: 0 auto; max-width: 220px; height: auto; filter: drop-shadow(0 0 14px rgba(0,229,255,0.35)); }

/* --- Headings --- */
h1, h2, h3 { font-weight: 800; letter-spacing: 0.02em; margin: 0 0 8px; }
p { color: var(--text-secondary); line-height: 1.5; }

/* --- Glass card --- */
.glass-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.4);
}

/* --- Neon buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 16px 20px;
    font-family: 'Exo', sans-serif;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: 999px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.25s ease, background 0.25s ease;
    background: rgba(255,255,255,0.04);
}
.btn:active { transform: scale(0.97); }

.btn-neon-cyan {
    color: var(--neon-cyan);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0,229,255,0.5), 0 0 30px rgba(0,229,255,0.25), inset 0 0 12px rgba(0,229,255,0.08);
    text-shadow: 0 0 8px rgba(0,229,255,0.8);
}
.btn-neon-cyan:hover { background: rgba(0,229,255,0.1); box-shadow: 0 0 18px rgba(0,229,255,0.8), 0 0 46px rgba(0,229,255,0.4); }

.btn-neon-magenta {
    color: var(--neon-magenta);
    border-color: var(--neon-magenta);
    box-shadow: 0 0 10px rgba(255,46,151,0.5), 0 0 30px rgba(255,46,151,0.25), inset 0 0 12px rgba(255,46,151,0.08);
    text-shadow: 0 0 8px rgba(255,46,151,0.8);
}
.btn-neon-magenta:hover { background: rgba(255,46,151,0.1); box-shadow: 0 0 18px rgba(255,46,151,0.8), 0 0 46px rgba(255,46,151,0.4); }

.btn-neon-white {
    color: #fff;
    border-color: #fff;
    box-shadow: 0 0 10px rgba(255,255,255,0.5), 0 0 30px rgba(255,255,255,0.25), inset 0 0 12px rgba(255,255,255,0.08);
    text-shadow: 0 0 8px rgba(255,255,255,0.8);
}
.btn-neon-white:hover { background: rgba(255,255,255,0.1); box-shadow: 0 0 18px rgba(255,255,255,0.8), 0 0 46px rgba(255,255,255,0.4); }

.btn-solid {
    background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
    color: #04040d;
    border: none;
    box-shadow: 0 0 20px rgba(124,77,255,0.45);
}
.btn-solid:hover { box-shadow: 0 0 28px rgba(124,77,255,0.7); }
.btn-solid:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--glass-border);
}

/* --- Forms --- */
.field { margin-bottom: 18px; }
.field label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--neon-cyan);
    margin-bottom: 8px;
    font-weight: 600;
}
.field input, .field select {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: 'Exo', sans-serif;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field input:focus, .field select:focus {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 0 3px rgba(0,229,255,0.15);
}
.field select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2300e5ff'><path d='M7 10l5 5 5-5z'/></svg>"); background-repeat: no-repeat; background-position: right 14px center; background-size: 20px; }
.field select option {
    background: #14142a;
    color: var(--text-primary);
}

.error-msg { color: var(--neon-magenta); font-size: 13px; margin-top: 10px; min-height: 16px; }
.hint-msg { color: var(--text-secondary); font-size: 13px; margin-top: 14px; text-align: center; }

.consent-field { margin-bottom: 4px; }
.consent-field .consent-label { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; text-transform: none; letter-spacing: normal; font-weight: 400; color: var(--text-secondary); }
.consent-label input[type="checkbox"] {
    width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; accent-color: var(--neon-cyan); cursor: pointer;
}
.consent-label span { font-size: 12.5px; line-height: 1.5; color: var(--text-secondary); text-align: left; }
.consent-label a { color: var(--neon-cyan); text-decoration: underline; }

/* --- Landing --- */
.landing-wrap { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 32px; text-align: center; width: 100%; transform: translateY(-40px); }
.landing-header-img { width: 100%; max-width: 340px; height: auto; display: block; margin: 0 auto; filter: drop-shadow(0 0 18px rgba(255,255,255,0.18)); }
.landing-buttons { width: 100%; display: flex; flex-direction: column; gap: 18px; }
.landing-footer-banners { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.landing-footer-img { width: 100%; max-width: 360px; height: auto; display: block; margin: 0 auto; border-radius: 10px; }
.landing-footer-banners a { display: block; width: 100%; max-width: 360px; }

/* Desktop: the mobile-tuned -40px vertical nudge (see .landing-wrap above) leaves a big empty
   gap at the bottom on tall/wide viewports instead of looking centered, so it's dropped here in
   favor of true centering; header/footer banners are also sized up so they don't look lost on
   a much larger canvas. */
@media (min-width: 900px) {
    .landing-wrap { transform: none; gap: 40px; }
    .landing-header-img { max-width: 480px; }
    .landing-footer-img, .landing-footer-banners a { max-width: 480px; }
}

/* --- Quiz header --- */
.quiz-header-title {
    text-align: center;
    font-size: clamp(20px, 6vw, 28px);
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin: 0 0 22px;
    color: var(--neon-cyan);
    text-shadow: 0 0 10px rgba(0,229,255,0.7), 0 0 30px rgba(0,229,255,0.35);
}

/* --- Progress dots (quiz) --- */
.progress-row { display: flex; gap: 8px; justify-content: center; margin-bottom: 22px; }
.progress-dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.18); transition: all 0.3s ease; }
.progress-dot.active { background: var(--neon-cyan); box-shadow: 0 0 10px rgba(0,229,255,0.8); width: 26px; border-radius: 6px; }
.progress-dot.done { background: var(--neon-purple); }

/* --- Quiz option cards --- */
.quiz-question { font-size: 20px; font-weight: 800; margin-bottom: 24px; text-align: center; }
.quiz-options { display: flex; flex-direction: column; gap: 14px; }
.quiz-option {
    padding: 16px 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    background: rgba(255,255,255,0.04);
    cursor: pointer;
    font-size: 15px;
    transition: all 0.2s ease;
}
.quiz-option:hover, .quiz-option.selected {
    border-color: var(--neon-cyan);
    background: rgba(0,229,255,0.08);
    box-shadow: 0 0 16px rgba(0,229,255,0.3);
    transform: translateX(4px);
}

/* --- AI loading --- */
.ai-loading { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; text-align: center; }
.ai-ring { width: 140px; height: 140px; border-radius: 50%; border: 3px solid rgba(0,229,255,0.15); border-top-color: var(--neon-cyan); border-right-color: var(--neon-magenta); animation: spin 1.1s linear infinite; position: relative; }
.ai-ring::after { content: ''; position: absolute; inset: 18px; border-radius: 50%; border: 2px dashed rgba(124,77,255,0.5); animation: spin 2.4s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
.ai-percent { font-size: 34px; font-weight: 900; color: var(--neon-cyan); text-shadow: 0 0 14px rgba(0,229,255,0.7); }
.ai-status { color: var(--text-secondary); font-size: 14px; letter-spacing: 0.05em; min-height: 20px; }
.ai-glitch { font-size: 12px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--neon-magenta); animation: flicker 1.6s infinite; }
@keyframes flicker { 0%,100%{opacity:1;} 45%{opacity:0.3;} 50%{opacity:1;} 82%{opacity:0.5;} }

/* --- ID Card (portrait) — background art (logo + personality title baked in) + name only --- */
.id-card-wrap { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.id-card {
    width: 100%;
    max-width: 360px;
    aspect-ratio: 672 / 1050;
    border-radius: 22px;
    overflow: hidden;
    position: relative;
    background-size: cover;
    background-position: center;
    box-shadow: 0 0 40px rgba(0,229,255,0.25), 0 20px 50px rgba(0,0,0,0.6);
    border: 1px solid var(--glass-border);
    margin: 0 auto;
}
.id-card-name {
    position: absolute;
    left: 14.3%;
    top: 26%;
    right: 8%;
    z-index: 2;
    margin: 0;
    font-family: 'Orbitron', 'Exo', sans-serif;
    font-weight: 700;
    line-height: 1.3;
    font-size: clamp(16px, 6.4vw, 26px); /* 80% of the original clamp(20px, 8vw, 32px) */
    color: #fff;
}
/* Habits ("The Planner") background is noticeably brighter than the other three, so its
   name text needs to be dark instead of white to stay readable — see PERSONALITY_DARK_TEXT_CODES
   in includes/card_render.php for the server-rendered equivalent. */
.id-card-name.dark-text { color: #14121f; }
.id-card-qr {
    position: absolute;
    left: 16.7%;
    top: 52%;
    width: 32.4%;
    aspect-ratio: 1/1;
    background: #fff;
    border-radius: 0;
    padding: 2%;
    box-sizing: border-box;
    z-index: 2;
}
.id-card-qr canvas, .id-card-qr img { width: 100%; height: 100%; }

/* --- Dashboard Digital ID preview — same card image, with a live QR overlaid bottom-left
       (the downloadable/printable file itself stays QR-free; this is a display-only addition) --- */
.dashboard-card-preview { position: relative; width: 100%; border-radius: 14px; overflow: hidden; margin-bottom: 16px; line-height: 0; }
.dashboard-card-img { width: 100%; display: block; }
.dashboard-card-qr {
    position: absolute;
    left: 16.7%;
    top: 52%;
    width: 32.4%;
    aspect-ratio: 1/1;
    background: #fff;
    border-radius: 0;
    padding: 2%;
    box-sizing: border-box;
}
.dashboard-card-qr canvas, .dashboard-card-qr img { width: 100%; height: 100%; }

/* --- Show QR modal --- */
.qr-modal-overlay {
    position: fixed; inset: 0; background: rgba(2,2,10,0.88); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    display: none; align-items: center; justify-content: center; z-index: 200; padding: 24px; box-sizing: border-box;
}
.qr-modal-overlay.open { display: flex; }
.qr-modal {
    background: var(--glass-bg-strong); border: 1px solid var(--glass-border); border-radius: var(--radius-lg);
    padding: 28px 24px; text-align: center; max-width: 420px; width: 100%; box-shadow: 0 0 40px rgba(0,229,255,0.25);
}
.qr-modal-box { width: 70vw; max-width: 320px; aspect-ratio: 1/1; background: #fff; border-radius: 14px; padding: 5%; margin: 18px auto; box-sizing: border-box; }
.qr-modal-box canvas, .qr-modal-box img { width: 100%; height: 100%; }
.qr-modal-info { color: var(--text-secondary); font-size: 13.5px; margin-top: 4px; }

/* --- Result reveal --- */
.result-personality-name { text-align: center; font-size: 26px; font-weight: 900; margin: 4px 0; text-shadow: 0 0 16px currentColor; }
.result-personality-desc { text-align: center; max-width: 420px; margin: 0 auto 18px; }

/* --- Burger menu --- */
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.topbar .brand-logo { margin: 0; max-width: 140px; }
.burger-btn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--glass-border); background: rgba(255,255,255,0.05); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; }
.burger-btn span { width: 20px; height: 2px; background: var(--neon-cyan); box-shadow: 0 0 6px rgba(0,229,255,0.8); }

.burger-drawer {
    position: fixed; top: 0; right: 0; height: 100dvh; width: min(84vw, 340px);
    background: var(--glass-bg-strong); backdrop-filter: blur(18px);
    border-left: 1px solid var(--glass-border);
    transform: translateX(100%); transition: transform 0.3s ease;
    z-index: 50; padding: 28px 22px; display: flex; flex-direction: column; gap: 6px;
}
.burger-drawer.open { transform: translateX(0); }
.burger-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); opacity: 0; pointer-events: none; transition: opacity 0.3s ease; z-index: 49; }
.burger-overlay.open { opacity: 1; pointer-events: auto; }
.burger-drawer a, .burger-drawer button.drawer-item {
    display: flex; align-items: center; gap: 12px; padding: 14px 10px; border-radius: var(--radius-sm);
    color: var(--text-primary); font-weight: 600; font-size: 15px; border: none; background: none; text-align: left; cursor: pointer; width: 100%;
}
.burger-drawer a:hover, .burger-drawer button.drawer-item:hover { background: rgba(0,229,255,0.08); color: var(--neon-cyan); }
.burger-close { align-self: flex-end; background: none; border: none; color: var(--text-secondary); font-size: 22px; cursor: pointer; }

/* --- Info pages / dashboard --- */
.info-list { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.info-item { padding: 16px; border-radius: var(--radius-md); background: rgba(255,255,255,0.04); border: 1px solid var(--glass-border); }
.info-item .time { color: var(--neon-cyan); font-weight: 700; font-size: 13px; letter-spacing: 0.05em; }
.map-embed { width: 100%; border: 0; border-radius: var(--radius-md); overflow: hidden; height: 320px; }
.venue-name { font-size: 17px; font-weight: 700; color: var(--neon-cyan); margin: 0 0 4px; }
.venue-address { font-size: 12.5px; color: var(--text-secondary); margin: 0 0 16px; line-height: 1.5; }
.profile-row { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--glass-border); font-size: 14px; }
.profile-row span:first-child { color: var(--text-secondary); }

.whatsapp-btn { background: #25D366; color: #04220f; box-shadow: 0 0 20px rgba(37,211,102,0.5); border: none; }

.wechat-qr-box {
    width: 200px;
    max-width: 60%;
    aspect-ratio: 1/1;
    margin: 16px auto 0;
    background: #fff;
    border-radius: 14px;
    padding: 10px;
    box-sizing: border-box;
    box-shadow: 0 0 24px rgba(37,211,102,0.35);
}
.wechat-qr-box img { width: 100%; height: 100%; display: block; object-fit: contain; }
