/* ============================================================
   QRCode.festim.ch — Dark & Neon Design System
   ============================================================ */

:root {
    --bg: #070711;
    --bg-card: rgba(255, 255, 255, 0.04);
    --border: rgba(255, 255, 255, 0.08);

    --primary: #8b5cf6;
    --primary-light: #a78bfa;
    --primary-dark: #7c3aed;
    --secondary: #06b6d4;
    --accent: #f472b6;

    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --text-subtle: #64748b;

    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    --radius: 16px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --shadow-glow: 0 0 30px rgba(139, 92, 246, 0.15);
    --shadow-card: 0 8px 40px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(255,255,255,0.05);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ── Background Orbs ── */
.bg-orbs { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: orb-float 12s ease-in-out infinite;
}

.orb-1 { width: 500px; height: 500px; background: radial-gradient(circle, #7c3aed, transparent 70%); top: -150px; left: -150px; animation-delay: 0s; }
.orb-2 { width: 400px; height: 400px; background: radial-gradient(circle, #0891b2, transparent 70%); bottom: -100px; right: -100px; animation-delay: -4s; }
.orb-3 { width: 300px; height: 300px; background: radial-gradient(circle, #db2777, transparent 70%); top: 40%; left: 60%; animation-delay: -8s; }

@keyframes orb-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -20px) scale(1.05); }
    66% { transform: translate(-20px, 15px) scale(0.95); }
}

/* ── Page Layout ── */
.app-body { position: relative; }

.page-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem;
}

/* ── Card ── */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card), var(--shadow-glow);
    padding: 2rem 1.75rem;
    width: 100%;
    max-width: 480px;
    animation: card-in .4s ease both;
}

@keyframes card-in {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.card-waiting { max-width: 400px; text-align: center; }

.card-header { text-align: center; margin-bottom: 2rem; }

.step-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.75rem;
    animation: bounce-in .5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes bounce-in {
    from { transform: scale(0.5); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.card-title {
    font-size: 1.625rem;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 0.375rem;
    background: linear-gradient(135deg, #e2e8f0, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.card-subtitle { color: var(--text-muted); font-size: 0.95rem; }

/* ── Progress ── */
.progress-bar-wrapper { margin-bottom: 2rem; }

.progress-steps { display: flex; align-items: center; justify-content: center; }

.progress-step { display: flex; align-items: center; }

.progress-dot {
    width: 32px; height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem; font-weight: 600;
    color: var(--text-muted);
    transition: all .3s ease;
    background: var(--bg);
}

.progress-step.active .progress-dot {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(139, 92, 246, 0.15);
    box-shadow: 0 0 16px rgba(139, 92, 246, 0.4);
}

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

.progress-line { width: 48px; height: 2px; background: var(--border); transition: background .3s ease; }
.progress-line.done { background: var(--success); }

/* ── Forms ── */
.form-group { margin-bottom: 1.5rem; }

.form-label {
    display: block;
    font-size: 0.875rem; font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.input-wrapper { position: relative; }

.form-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.875rem 3rem 0.875rem 1rem;
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    transition: all .2s ease;
    outline: none;
    -webkit-appearance: none;
}

.form-input:focus {
    border-color: var(--primary);
    background: rgba(139, 92, 246, 0.08);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.form-input::placeholder { color: var(--text-subtle); }
.form-input.input-error { border-color: var(--danger); }

.input-icon { position: absolute; right: 0.875rem; top: 50%; transform: translateY(-50%); font-size: 1.1rem; pointer-events: none; }

.select-wrapper { position: relative; }

.form-select {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.875rem 2.5rem 0.875rem 1rem;
    color: var(--text);
    font-size: 1rem; font-family: inherit;
    transition: all .2s ease;
    outline: none; -webkit-appearance: none; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.875rem center;
}

.form-select:focus {
    border-color: var(--primary);
    background-color: rgba(139, 92, 246, 0.08);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.form-select option { background: #1a1a2e; color: var(--text); }
.field-error { color: var(--danger); font-size: 0.82rem; margin-top: 0.375rem; }

/* ── Options ── */
.options-group { margin-top: 1.5rem; }
.options-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.75rem; }

.option-card { position: relative; cursor: pointer; }
.option-card input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }

.option-label {
    display: block;
    padding: 0.875rem 1rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-align: center;
    font-size: 0.95rem; font-weight: 500;
    color: var(--text-muted);
    transition: all .2s ease;
    cursor: pointer; user-select: none;
}

.option-check {
    display: none;
    position: absolute;
    top: -8px; right: -8px;
    background: var(--primary); color: #fff;
    width: 20px; height: 20px;
    border-radius: 50%; font-size: 0.7rem;
    align-items: center; justify-content: center;
}

.option-card input:checked ~ .option-label {
    border-color: var(--primary);
    background: rgba(139, 92, 246, 0.12);
    color: var(--primary-light);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
}

.option-card input:checked ~ .option-check { display: flex; }
.option-card:hover .option-label { border-color: rgba(139,92,246,0.4); background: rgba(255,255,255,0.07); color: var(--text); }

/* ── Gender ── */
.gender-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }

.gender-card { position: relative; cursor: pointer; display: block; }
.gender-card input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }

.gender-inner {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 0.4rem;
    padding: 1rem 0.5rem;
    background: rgba(255,255,255,0.04);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all .2s ease;
    text-align: center;
    user-select: none;
}

.gender-emoji { font-size: 2rem; line-height: 1; display: block; }

.gender-text {
    display: block;
    font-size: 0.875rem; font-weight: 500;
    color: var(--text-muted);
    transition: color .2s ease;
}

.gender-card input:checked ~ .gender-inner {
    border-color: var(--primary);
    background: rgba(139,92,246,0.14);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.25);
}

.gender-card input:checked ~ .gender-inner .gender-text { color: var(--primary-light); }

.gender-card:hover .gender-inner:not(.selected) {
    border-color: rgba(139,92,246,0.35);
    background: rgba(255,255,255,0.07);
}

.gender-card:hover .gender-inner .gender-text { color: var(--text); }

/* ── Buttons ── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border-radius: var(--radius-sm);
    font-size: 1rem; font-weight: 600; font-family: inherit;
    text-decoration: none; border: none; cursor: pointer;
    transition: all .2s ease; white-space: nowrap;
    position: relative; overflow: hidden;
}

.btn::after { content: ''; position: absolute; inset: 0; background: rgba(255,255,255,0); transition: background .2s ease; }
.btn:hover::after { background: rgba(255,255,255,0.06); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: #fff;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.35);
}
.btn-primary:hover { box-shadow: 0 6px 28px rgba(139, 92, 246, 0.5); transform: translateY(-1px); }

.btn-secondary { background: rgba(255,255,255,0.08); color: var(--text); border: 1px solid var(--border); }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: rgba(255,255,255,0.2); }
.btn-danger { background: rgba(239,68,68,0.15); color: var(--danger); border: 1px solid rgba(239,68,68,0.3); }
.btn-danger:hover { background: rgba(239,68,68,0.25); }
.btn-full { width: 100%; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.875rem; }
.btn-xs { padding: 0.3rem 0.65rem; font-size: 0.8rem; border-radius: var(--radius-xs); }

.btn-row { display: flex; gap: 0.75rem; align-items: center; justify-content: space-between; }
.btn-los { padding: 1.1rem; font-size: 1.15rem; letter-spacing: 0.02em; }

/* ── Summary ── */
.summary-grid {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 1.75rem;
}

.summary-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border);
    transition: background .2s;
}
.summary-item:last-child { border-bottom: none; }
.summary-item:hover { background: rgba(255,255,255,0.03); }
.summary-label { color: var(--text-muted); font-size: 0.875rem; }
.summary-value { font-weight: 600; color: var(--text); }
.summary-option { background: rgba(139,92,246,0.15); color: var(--primary-light); padding: 0.2rem 0.6rem; border-radius: 20px; font-size: 0.875rem; }
.summary-photo { width: 60px; height: 60px; border-radius: 10px; object-fit: cover; }
.summary-photo-item { align-items: flex-start; }

/* ── Photo Upload ── */
.photo-upload-area {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2rem; text-align: center; cursor: pointer;
    transition: all .2s ease; min-height: 180px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 1rem; overflow: hidden;
}
.photo-upload-area:hover, .photo-upload-area.drag-over { border-color: var(--primary); background: rgba(139,92,246,0.06); }
.photo-file-input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.photo-placeholder { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; pointer-events: none; }
.photo-icon { font-size: 2.5rem; }
.photo-hint { color: var(--text-muted); font-size: 0.95rem; }
.photo-hint-sub { color: var(--text-subtle); font-size: 0.8rem; }
.photo-preview-wrapper { position: relative; width: 100%; }
.photo-preview { width: 100%; max-height: 250px; object-fit: cover; border-radius: 10px; }
.photo-remove { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,0.7); border: none; color: #fff; width: 28px; height: 28px; border-radius: 50%; font-size: 0.8rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.photo-btns { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

/* ── Waiting Timer ── */
.waiting-state { padding: 2rem 0; }
.waiting-spinner { position: relative; width: 120px; height: 120px; margin: 0 auto 2rem; }
.timer-ring { display: block; }
.timer-ring-bg { stroke: rgba(255,255,255,0.08); }
.timer-ring-fill { stroke: var(--primary); stroke-linecap: round; transition: stroke-dashoffset 0.5s linear; filter: drop-shadow(0 0 6px rgba(139,92,246,0.7)); }
.timer-count { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 2.2rem; font-weight: 700; color: var(--primary-light); }
.waiting-messages { min-height: 2rem; }
.waiting-msg { display: none; font-size: 1.1rem; color: var(--text-muted); animation: fade-in .4s ease; }
.waiting-msg.active { display: block; }

@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ── Action Content ── */
.action-state { width: 100%; }
.action-content { padding: 0.5rem 0; }
.action-icon-large { font-size: 4rem; margin-bottom: 1rem; }

.action-title {
    font-size: 1.5rem; font-weight: 700; margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #e2e8f0, #a78bfa);
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}

.action-desc { color: var(--text-muted); margin-bottom: 1rem; }
.video-wrapper { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 12px; margin-top: 1rem; }
.video-wrapper iframe, .video-frame { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border-radius: 12px; }
.video-native { width: 100%; border-radius: 12px; margin-top: 1rem; }
.meme-img { width: 100%; border-radius: 12px; margin-top: 1rem; max-height: 400px; object-fit: contain; }

.extra-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent), #fb923c);
    color: #fff; padding: 0.4rem 1rem;
    border-radius: 20px; font-weight: 700; font-size: 0.9rem;
    margin-bottom: 1.5rem;
    animation: extra-pop .5s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes extra-pop { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.no-action-msg { padding: 2rem; color: var(--text-muted); }

/* ── Checkbox / Radio ── */
.checkbox-card {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: rgba(255,255,255,0.03); border: 1px solid var(--border);
    border-radius: var(--radius-sm); cursor: pointer; transition: all .2s ease;
}
.checkbox-card:hover { border-color: var(--primary); background: rgba(139,92,246,0.06); }
.checkbox-card input { position: absolute; opacity: 0; width: 0; }
.checkbox-box { width: 20px; height: 20px; border: 2px solid var(--border); border-radius: 5px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: all .2s ease; }
.checkbox-card input:checked ~ .checkbox-box { background: var(--primary); border-color: var(--primary); }
.checkbox-card input:checked ~ .checkbox-box::after { content: '✓'; color: #fff; font-size: 0.75rem; font-weight: 700; }
.checkbox-text { color: var(--text-muted); font-size: 0.95rem; }
.checkbox-card input:checked ~ .checkbox-text { color: var(--text); }

.radio-row { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.radio-card { flex: 1; min-width: 120px; display: flex; align-items: center; gap: 0.5rem; padding: 0.75rem 1rem; background: rgba(255,255,255,0.03); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; transition: all .2s ease; font-size: 0.9rem; color: var(--text-muted); }
.radio-card input[type="radio"] { accent-color: var(--primary); }
.radio-card:has(input:checked) { border-color: var(--primary); background: rgba(139,92,246,0.1); color: var(--text); }

/* ── Flash ── */
.flash { position: fixed; top: 1rem; left: 50%; transform: translateX(-50%); z-index: 1000; display: flex; align-items: center; gap: 0.75rem; padding: 0.875rem 1.25rem; border-radius: var(--radius-sm); max-width: 480px; width: calc(100% - 2rem); animation: flash-in .3s ease; backdrop-filter: blur(10px); }
@keyframes flash-in { from { opacity: 0; transform: translateX(-50%) translateY(-16px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
.flash-success { background: rgba(16,185,129,0.2); border: 1px solid rgba(16,185,129,.4); color: #6ee7b7; }
.flash-error   { background: rgba(239,68,68,0.2);  border: 1px solid rgba(239,68,68,.4);  color: #fca5a5; }
.flash-info    { background: rgba(6,182,212,0.2);  border: 1px solid rgba(6,182,212,.4);  color: #67e8f9; }
.flash-close { background: none; border: none; cursor: pointer; color: inherit; opacity: 0.7; margin-left: auto; font-size: 1rem; }
.flash-close:hover { opacity: 1; }

/* ── Success ── */
.success-animation { display: flex; justify-content: center; margin-bottom: 1rem; }
.success-circle { width: 80px; height: 80px; border-radius: 50%; background: linear-gradient(135deg, var(--success), #34d399); display: flex; align-items: center; justify-content: center; font-size: 2rem; color: #fff; animation: success-pop .6s cubic-bezier(0.34,1.56,0.64,1) both; box-shadow: 0 0 30px rgba(16,185,129,0.4); }
@keyframes success-pop { from { transform: scale(0) rotate(-30deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }
.confetti-emoji { font-size: 1.5rem; margin-top: 1.5rem; letter-spacing: 0.3rem; animation: fade-in 1s ease .5s both; }

.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Action Override Overlay ── */
.action-override-overlay {
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(7, 7, 17, 0);
    display: none;
    align-items: flex-end;
    justify-content: center;
    padding: 1rem;
    transition: background .4s ease;
    pointer-events: none;
}

.action-override-overlay.action-override-visible {
    background: rgba(7, 7, 17, 0.92);
    pointer-events: all;
}

.action-override-inner {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: var(--radius);
    box-shadow: 0 -8px 60px rgba(139, 92, 246, 0.25), 0 0 0 1px rgba(255,255,255,0.05);
    padding: 2rem 1.75rem;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(60px);
    opacity: 0;
    transition: transform .45s cubic-bezier(0.34, 1.1, 0.64, 1), opacity .35s ease;
}

.action-override-visible .action-override-inner {
    transform: translateY(0);
    opacity: 1;
}

.action-override-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent), #fb923c);
    color: #fff;
    padding: 0.4rem 1.1rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    animation: extra-pop .5s cubic-bezier(0.34, 1.56, 0.64, 1) .1s both;
}

.action-override-content { text-align: center; }

.los-loading { display: flex; align-items: center; gap: 0.5rem; }

/* ── Mobile ── */
@media (max-width: 480px) {
    .card { padding: 1.5rem 1.25rem; }
    .card-title { font-size: 1.4rem; }
    .options-grid { grid-template-columns: repeat(2, 1fr); }
    .progress-line { width: 32px; }
    .btn-row { flex-wrap: wrap; }
}
