/* xbody Scanner — Custom Styles */

body { font-family: 'Space Grotesk', sans-serif; }

/* Screens (Tab-System) */
.screen { display: none; animation: fadeIn .25s ease; }
.screen.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Action-Buttons (Camera / Upload) */
.btn-action {
    display: flex; align-items: center; gap: 1rem;
    background: #fff; border: 1px solid #e5e7eb;
    border-radius: 1rem; padding: 1rem 1.25rem;
    transition: all .25s ease;
}
.btn-action:hover { border-color: #f8bf00; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.06); }
.btn-action-icon {
    width: 48px; height: 48px; border-radius: .85rem;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

/* Bottom-Tab */
.tab-btn, .tab-btn-primary {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: .25rem .75rem; font-size: 11px; color: #6b7280;
    background: none; border: none;
    transition: color .2s;
}
.tab-btn:hover, .tab-btn.active { color: #111; }
.tab-btn.active i { color: #d9a500; }
.tab-btn i { font-size: 16px; }
.tab-btn:active { transform: scale(.92); }

/* Score-Donut */
.score-donut {
    position: relative; width: 140px; height: 140px;
}
.score-donut svg { transform: rotate(-90deg); }
.score-donut-bg { stroke: #e5e7eb; }
.score-donut-fill { stroke: #f8bf00; transition: stroke-dashoffset 1.2s cubic-bezier(.34,1.56,.64,1); }
.score-donut-text {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.score-donut-text .num { font-size: 2.4rem; font-weight: 700; line-height: 1; color: #111; }
.score-donut-text .lbl { font-size: 10px; color: #9ca3af; letter-spacing: 1px; text-transform: uppercase; margin-top: 4px; }

/* Rating Pills */
.pill {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .25rem .6rem; border-radius: 999px;
    font-size: .7rem; font-weight: 600;
}
.pill-good    { background: #ecfdf5; color: #047857; }
.pill-neutral { background: #f3f4f6; color: #4b5563; }
.pill-warning { background: #fef3c7; color: #92400e; }
.pill-bad     { background: #fee2e2; color: #b91c1c; }

/* Ingredient Cards */
.ingredient-row {
    background: #fff; border: 1px solid #f3f4f6;
    border-radius: .85rem; padding: .85rem 1rem;
    margin-bottom: .5rem;
    transition: all .2s;
}
.ingredient-row.expanded { border-color: #f8bf00; background: #fffbeb; }
.ingredient-row .name-row {
    display: flex; align-items: center; gap: .5rem; cursor: pointer;
}

/* Nutrition Bars */
.nutri-bar { height: 6px; border-radius: 999px; background: #f3f4f6; overflow: hidden; }
.nutri-bar-fill { height: 100%; transition: width 1s ease .2s; }
.nutri-bar-fill.good    { background: linear-gradient(90deg, #34d399, #10b981); }
.nutri-bar-fill.neutral { background: linear-gradient(90deg, #d1d5db, #9ca3af); }
.nutri-bar-fill.warning { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.nutri-bar-fill.bad     { background: linear-gradient(90deg, #f87171, #dc2626); }

/* Cards */
.card {
    background: #fff; border-radius: 1rem; padding: 1.25rem;
    border: 1px solid #f3f4f6;
}

/* Hero Approved-Recommendation */
.alt-hero {
    background: linear-gradient(135deg, #111111 0%, #1f1f1f 100%);
    color: #fff; border-radius: 1.25rem;
    padding: 1.5rem; position: relative; overflow: hidden;
}
.alt-hero::before {
    content: ''; position: absolute; top: -40px; right: -40px;
    width: 140px; height: 140px; border-radius: 50%;
    background: radial-gradient(circle, #f8bf00 0%, transparent 70%);
    opacity: .35;
}

/* Multi-Produkt Stack innerhalb der Alt-Hero */
.alt-product-stack {
    display: flex; flex-direction: column; gap: .65rem;
}
.alt-product {
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: .85rem;
    padding: .85rem .9rem;
    transition: all .25s;
    position: relative;
}
.alt-product:hover {
    background: rgba(255,255,255,.10);
    border-color: rgba(248,191,0,.35);
}
.alt-product.top-pick {
    background: rgba(248,191,0,.08);
    border-color: rgba(248,191,0,.30);
}
.top-pick-ribbon {
    position: absolute;
    top: -10px; right: 12px;
    background: #f8bf00; color: #111;
    font-size: 9px; font-weight: 700;
    letter-spacing: 1.5px; text-transform: uppercase;
    padding: 3px 9px; border-radius: 999px;
    box-shadow: 0 4px 10px rgba(248,191,0,.35);
}

/* Pharmacy Card */
.pharmacy-card {
    background: #fff; border: 1px solid #e5e7eb;
    border-radius: .85rem; padding: 1rem;
    transition: all .2s;
}
.pharmacy-card:hover { border-color: #f8bf00; }

/* Goal Picker tiles */
.goal-tile {
    background: #fff; border: 2px solid #e5e7eb;
    border-radius: 1rem; padding: 1.25rem;
    cursor: pointer; transition: all .25s;
    text-align: left;
}
.goal-tile:hover { border-color: #f8bf00; transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,.06); }
.goal-tile .ic {
    width: 44px; height: 44px; border-radius: .75rem;
    background: #fff8e1; color: #d9a500;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: .75rem;
}

/* Section header */
.section-eyebrow {
    font-size: 10px; font-weight: 700; color: #d9a500;
    letter-spacing: 2px; text-transform: uppercase;
    margin-bottom: .5rem;
}
.section-title {
    font-size: 1.25rem; font-weight: 700; color: #111;
    margin-bottom: 1rem;
}

/* Loading-Steps */
.loading-step {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #e5e7eb;
    transition: all .3s ease;
}
.loading-step-active {
    background: #f8bf00;
    transform: scale(1.4);
    box-shadow: 0 0 10px rgba(248,191,0,.55);
}

/* Animated count-up bar */
@keyframes growBar { from { width: 0; } }
.nutri-bar-fill { animation: growBar 1s ease forwards; }

/* ─────────────────────────────────────────────────────────
   APP-Home — emotionale, app-typische UI
   ───────────────────────────────────────────────────────── */

/* Scan-Orb (Hero-Aktion) */
.scan-orb {
    position: relative;
    width: 200px; height: 200px;
    border: none; cursor: pointer;
    background: transparent;
    padding: 0;
}
.scan-orb .orb-ring {
    position: absolute; inset: 0;
    border-radius: 50%;
    pointer-events: none;
}
.scan-orb .orb-ring-1 {
    background: radial-gradient(circle, rgba(248,191,0,.45) 0%, rgba(248,191,0,0) 65%);
    animation: orbPulse 2.5s ease-in-out infinite;
}
.scan-orb .orb-ring-2 {
    background: radial-gradient(circle, rgba(248,191,0,.25) 0%, rgba(248,191,0,0) 65%);
    animation: orbPulse 2.5s ease-in-out infinite .8s;
}
.scan-orb .orb-center {
    position: absolute; inset: 30px;
    border-radius: 50%;
    background: linear-gradient(145deg, #ffd54a 0%, #f8bf00 50%, #d9a500 100%);
    box-shadow:
        0 14px 36px rgba(248,191,0,.45),
        0 6px 14px rgba(0,0,0,.08),
        inset 0 -4px 12px rgba(0,0,0,.10),
        inset 0 4px 8px rgba(255,255,255,.30);
    display: flex; align-items: center; justify-content: center;
    transition: transform .15s ease;
}
.scan-orb:active .orb-center { transform: scale(.94); }
.scan-orb:hover .orb-center  { transform: scale(1.03); }
@keyframes orbPulse {
    0%, 100% { transform: scale(1);    opacity: 1; }
    50%      { transform: scale(1.18); opacity: 0; }
}

/* Quick-Chips Reihe */
.quick-row {
    display: flex; gap: .5rem;
    overflow-x: auto; overflow-y: hidden;
    margin: 0 -1.25rem; padding: .25rem 1.25rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.quick-row::-webkit-scrollbar { display: none; }

.quick-chip {
    flex-shrink: 0;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: .55rem .9rem;
    font-size: .85rem;
    font-weight: 600; color: #1a1a1a;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    transition: all .2s;
    cursor: pointer;
}
.quick-chip:hover, .quick-chip:active {
    border-color: #f8bf00;
    background: #fff8e1;
    transform: translateY(-1px);
}
.quick-chip .emoji { font-size: 1rem; }

/* Trust-Card (Dark Hero unten) — dezenter als zuvor */
.trust-card {
    position: relative;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border-radius: 1rem;
    padding: 1.1rem 1.2rem;
    overflow: hidden;
    margin-bottom: 0.5rem;
}
.trust-glow {
    position: absolute; top: -30px; right: -30px;
    width: 110px; height: 110px;
    border-radius: 50%;
    background: radial-gradient(circle, #f8bf00 0%, transparent 70%);
    opacity: .15; pointer-events: none;
}

/* Recent-Scan Mini-Card (im Home-Karussell) */
.recent-card {
    flex-shrink: 0;
    width: 150px;
    background: #fff;
    border-radius: .85rem;
    padding: .75rem;
    border: 1px solid #f3f4f6;
    cursor: pointer;
    transition: all .2s;
}
.recent-card:hover { border-color: #f8bf00; transform: translateY(-2px); }
.recent-card .score-circle {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .85rem;
    margin-bottom: .5rem;
}
.recent-card .name {
    font-size: .8rem; font-weight: 600;
    color: #111;
    overflow: hidden; text-overflow: ellipsis;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.25; min-height: 2em;
}
.recent-card .brand {
    font-size: .65rem; color: #9ca3af;
    margin-top: .15rem;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.recent-card .recent-replay {
    margin-top: .5rem;
    font-size: .65rem; color: #d9a500;
    font-weight: 600;
    display: flex; align-items: center; gap: 3px;
}
.recent-clickable:active { transform: scale(.98); }

.history-row {
    border: 1px solid #f3f4f6;
    background: #fff;
    text-align: left;
    transition: all .2s;
}
.history-row-clickable { cursor: pointer; }
.history-row-clickable:hover {
    border-color: #f8bf00;
    background: #fffdf5;
}
.history-row-clickable:active { transform: scale(.99); }
.history-row[disabled] { cursor: default; opacity: .7; }

/* ─── Generischer Input/Select für Profil-Formulare ─── */
.input, select.input, textarea.input {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0.65rem 0.9rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.65rem;
    font-size: 0.92rem;
    background: #fff;
    color: #1a1a1a;
    font-family: inherit;
    line-height: 1.3;
    transition: border-color .2s, box-shadow .2s;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    background-size: 14px;
    padding-right: 2rem;
}
input.input, textarea.input {
    background-image: none;
    padding-right: 0.9rem;
}
.input:focus {
    outline: none;
    border-color: #f8bf00;
    box-shadow: 0 0 0 3px rgba(248,191,0,.18);
}

/* ─── Auth-Screen — alle Inputs/Buttons exakt gleich breit ─── */
.auth-container {
    max-width: 28rem;
    margin: 0 auto;
    padding: 0 4px;
    box-sizing: border-box;
}
.auth-form {
    display: flex; flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}
.auth-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #4a4a4a;
    margin-bottom: -0.4rem;
    margin-top: 0.4rem;
    display: block;
}
.auth-input {
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 0.85rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.7rem;
    font-size: 0.95rem;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
    display: block;
    font-family: inherit;
}
.auth-input:focus {
    outline: none;
    border-color: #f8bf00;
    box-shadow: 0 0 0 3px rgba(248,191,0,.18);
}
.auth-input-otp {
    text-align: center;
    font-size: 1.6rem;
    letter-spacing: 0.5rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
}
.auth-submit {
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 0.85rem 1rem;
    border-radius: 0.7rem;
    background: #f8bf00;
    color: #111;
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: background .2s;
    display: block;
    margin-top: 0.5rem;
}
.auth-submit:hover { background: #d9a500; }
.auth-submit:active { transform: scale(0.98); }

.auth-remember {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    color: #4a4a4a;
    cursor: pointer;
    user-select: none;
}
.auth-remember input { width: 1rem; height: 1rem; accent-color: #f8bf00; }

.auth-link-btn {
    background: none;
    border: none;
    color: #d9a500;
    font-size: 0.85rem;
    text-decoration: underline;
    cursor: pointer;
    margin-top: 0.25rem;
    padding: 0.5rem;
}

.auth-info {
    font-size: 0.78rem;
    color: #047857;
    background: #ecfdf5;
    padding: 0.55rem 0.85rem;
    border-radius: 0.55rem;
    margin-top: 0.25rem;
}
.auth-error {
    font-size: 0.78rem;
    color: #b91c1c;
    background: #fef2f2;
    padding: 0.55rem 0.85rem;
    border-radius: 0.55rem;
    margin-top: 0.25rem;
}

/* Google-Button */
.auth-google {
    width: 100%;
    box-sizing: border-box;
    padding: 0.85rem 1rem;
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 0.7rem;
    font-weight: 600;
    color: #1a1a1a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    transition: all .2s;
    font-size: 0.95rem;
    font-family: inherit;
}
.auth-google:hover {
    border-color: #b5b5b5;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.auth-google-icon { display: inline-flex; align-items: center; }

/* OR-Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.25rem 0;
    color: #9ca3af;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.auth-divider::before,
.auth-divider::after {
    content: ''; flex: 1; height: 1px; background: #e5e7eb;
}

/* Method-Tabs */
.auth-method-tabs {
    display: flex;
    gap: 0.5rem;
    background: #f3f4f6;
    border-radius: 0.6rem;
    padding: 4px;
    margin-bottom: 1rem;
}
.auth-tab {
    flex: 1;
    padding: 0.55rem 0.5rem;
    border: none;
    background: transparent;
    border-radius: 0.45rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    font-family: inherit;
    transition: all .2s;
}
.auth-tab-active {
    background: #fff;
    color: #111;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

/* Responsive font tweaks */
@media (max-width: 640px) {
    h1 { font-size: 2rem !important; line-height: 1.15; }
    .score-donut { width: 120px; height: 120px; }
    .score-donut-text .num { font-size: 2rem; }
    .scan-orb { width: 180px; height: 180px; }
    .scan-orb .orb-center { inset: 26px; }
}

/* ── PDF-Export (html2pdf.js) ────────────────────────────
   Elemente, die NICHT im PDF erscheinen sollen.
   Wird via JS toggle vor/nach dem Capture gesetzt. */
.pdf-hidden { display: none !important; }

/* Bottom-Tab im PDF ausblenden (bleibt auf dem Bildschirm sichtbar) */
@media print {
    nav#bottom-tab,
    .pdf-hidden,
    .result-ctas { display: none !important; }
}
