/* ========================================================================
   Sanopoly Supplement-Wizard — Styles
   ======================================================================== */

/* Variables — auf die Relaunch-Farbwelt gemappt (Coral/Greige/Warmgrau statt der
   fruehereren Tailwind-Palette in Blau/Gruen). Die Variablennamen bleiben, damit
   die restliche Datei unveraendert bleibt.

   Text- und Flaechenwerte zeigen auf die Theme-Tokens, damit der Berater am Dark Mode
   teilnimmt: feste Werte koennen nicht umschalten, und der Berater stand dadurch mit heller
   Flaeche unter hellem Text. Die hellen Werte der Tokens sind dieselben wie vorher. Was keine
   Entsprechung im Theme hat — die Akzentflaechen der Hinweisboxen — steht weiter fest und
   bekommt unten einen eigenen dunklen Satz. */
:root {
    --sw-gray: var(--text, #504f4e);              /* Warmgrau — Fliesstext/Headlines */
    --sw-gray-light: var(--text-soft, #767472);
    --sw-gray-lighter: var(--text-muted, #aaa8a6);
    --sw-gray-bg: var(--surface-2, #f7f7f5);      /* Greige-Band */
    --sw-white: var(--surface, #ffffff);
    --sw-green: #d58878;         /* "Erfolg"/Primaer = Sanopoly Coral */
    --sw-green-light: #e0a294;
    --sw-green-bg: #faf4f2;
    --sw-green-border: #e8cfc9;
    --sw-blue: #d58878;          /* Info-Akzent ebenfalls Coral */
    --sw-blue-light: #e0a294;
    --sw-blue-bg: #faf4f2;
    --sw-blue-border: #e8cfc9;
    --sw-amber: #b8894a;         /* Hinweis — gedecktes Warmbraun statt Signal-Amber */
    --sw-amber-bg: #faf6f0;
    --sw-amber-border: #e6d5bd;
    --sw-red: #b3573f;           /* Fehler/Akzenttext — dunkles Coral */
    --sw-red-bg: #faf1ee;
    --sw-amber-text: #7a5a2e;    /* Text im Hinweisfeld */
    --sw-radius: 2px;            /* Relaunch ist kantig (Karten), Buttons sind Pills */
    --sw-radius-sm: 2px;
    --sw-shadow: none;
    --sw-shadow-lg: 0 10px 30px rgba(80, 79, 78, 0.12);
    --sw-transition: 0.15s ease;
}

/* Akzentflaechen der Hinweis-, Erfolgs- und Fehlerboxen im dunklen Modus. Fuer sie gibt es
   kein Theme-Token; die Signalfarbe steckt ohnehin in Text und Rahmen, die hell bleiben.
   Beide Schreibweisen wie im Theme: ausdruecklich gewaehlt und ueber die Systemeinstellung. */
:root[data-theme='dark'] {
    --sw-green-bg: #2b2320;
    --sw-green-border: #46423f;
    --sw-blue-bg: #2b2320;
    --sw-blue-border: #46423f;
    --sw-amber-bg: #2a2522;
    --sw-amber-border: #46423f;
    --sw-red-bg: #2e2320;
    --sw-red: #e0a294;
    --sw-amber-text: #d2ab72;
    --sw-shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.55);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme='light']) {
        --sw-green-bg: #2b2320;
        --sw-green-border: #46423f;
        --sw-blue-bg: #2b2320;
        --sw-blue-border: #46423f;
        --sw-amber-bg: #2a2522;
        --sw-amber-border: #46423f;
        --sw-red-bg: #2e2320;
        --sw-red: #e0a294;
        --sw-amber-text: #d2ab72;
        --sw-shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.55);
    }
}

/* ========================================================================
   Layout
   ======================================================================== */

.supplement-wizard {
    max-width: 720px;
    margin: 40px auto;
    padding: 0 var(--page-gutter, 20px);
    font-family: var(--font-default, 'Gudea', 'Helvetica Neue', Arial, sans-serif);
    color: var(--sw-gray);
    -webkit-font-smoothing: antialiased;
}

/* ========================================================================
   Progress Bar
   ======================================================================== */

.sw-progress {
    margin-bottom: 32px;
    text-align: center;
}

.sw-progress-bar {
    height: 6px;
    background: var(--border, #e8e6df);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.sw-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--sw-green), var(--sw-green-light));
    border-radius: 3px;
    transition: width 0.5s ease;
    width: 0%;
}

.sw-progress-text {
    font-size: 14px;
    color: var(--sw-gray-lighter);
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* ========================================================================
   Screens
   ======================================================================== */

.sw-screen {
    display: none;
}

.sw-screen-active {
    display: block;
    animation: swFadeIn 0.4s ease;
}

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

.sw-fade-in {
    animation: swFadeIn 0.4s ease;
}

/* ========================================================================
   Intro
   ======================================================================== */

.sw-intro {
    text-align: center;
    padding: 60px 0 40px;
}

.sw-intro-icon {
    margin-bottom: 24px;
}

.sw-intro-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--sw-gray);
    margin-bottom: 16px;
    line-height: 1.3;
}

.sw-intro-text {
    font-size: 17px;
    color: var(--sw-gray-light);
    line-height: 1.6;
    max-width: 520px;
    margin: 0 auto 32px;
}

.sw-intro-note {
    font-size: 13px;
    color: var(--sw-gray-lighter);
    margin-top: 16px;
}

/* ========================================================================
   Buttons
   ======================================================================== */

.sw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 200px; /* Pill wie im uebrigen Relaunch */
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--sw-transition);
    text-decoration: none;
    line-height: 1.4;
}

.sw-btn-primary,
.sw-btn-primary:visited,
.sw-btn-primary:active {
    background: var(--sw-green);
    color: #ffffff;
    padding: 14px 32px;
}

.sw-btn-primary:hover {
    background: #b3573f;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: var(--sw-shadow-lg);
}

.sw-btn-secondary {
    background: var(--sw-white);
    color: var(--sw-gray);
    border: 2px solid var(--border, #e8e6df);
    padding: 12px 28px;
}

.sw-btn-secondary:hover {
    border-color: var(--sw-gray-lighter);
    background: var(--sw-gray-bg);
}

.sw-btn-lg {
    font-size: 17px;
    padding: 16px 36px;
}

.sw-btn-back {
    background: none;
    color: var(--sw-gray-lighter);
    padding: 10px 16px;
    font-size: 14px;
    margin-top: 24px;
}

.sw-btn-back:hover {
    color: var(--sw-gray);
}

.sw-btn-shop {
    background: var(--sw-green);
    color: var(--sw-white);
    padding: 10px 24px;
    font-size: 14px;
    margin-top: 12px;
}

.sw-btn-shop,
.sw-btn-shop:visited,
.sw-btn-shop:active {
    color: #ffffff;
}

.sw-btn-shop:hover {
    background: #b3573f;
    color: #ffffff;
}

.sw-btn-continue {
    width: 100%;
    padding: 14px;
    margin-top: 8px;
}

.sw-btn-continue:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.sw-btn-basket {
    background: var(--sw-green);
    color: #ffffff;
    font-size: 17px;
    font-weight: 700;
    padding: 16px 36px;
    width: 100%;
    text-align: center;
    box-shadow: 0 4px 14px rgba(34, 197, 94, 0.3);
}

.sw-btn-basket:hover {
    background: #b3573f;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

.sw-btn-basket:visited,
.sw-btn-basket:active {
    color: #ffffff;
}

/* ========================================================================
   Questions
   ======================================================================== */

.sw-question {
    text-align: center;
    padding: 20px 0;
}

.sw-question-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--sw-gray);
    margin-bottom: 8px;
    line-height: 1.3;
}

.sw-question-subtitle {
    font-size: 15px;
    color: var(--sw-gray-lighter);
    margin-bottom: 28px;
}

.sw-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 480px;
    margin: 0 auto;
}

.sw-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--border, #e8e6df);
    border-radius: var(--sw-radius);
    background: var(--sw-white);
    cursor: pointer;
    font-family: inherit;
    font-size: 16px;
    color: var(--sw-gray);
    text-align: left;
    transition: all var(--sw-transition);
}

.sw-option:hover {
    border-color: var(--sw-green-light);
    background: var(--sw-green-bg);
    transform: translateY(-1px);
    box-shadow: var(--sw-shadow);
}

.sw-option-selected {
    border-color: var(--sw-green) !important;
    background: var(--sw-green-bg) !important;
    box-shadow: 0 0 0 1px var(--sw-green);
}

.sw-option-icon {
    font-size: 24px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sw-gray-bg);
    border-radius: 50%;
    flex-shrink: 0;
}

.sw-option-label {
    flex: 1;
    font-weight: 500;
}

/* Multi-select checkbox */
.sw-option-check {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border, #e8e6df);
    border-radius: 6px;
    flex-shrink: 0;
    position: relative;
    transition: all var(--sw-transition);
}

.sw-option-selected .sw-option-check {
    background: var(--sw-green);
    border-color: var(--sw-green);
}

.sw-option-selected .sw-option-check::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 6px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.sw-option-none {
    border-style: dashed;
    color: var(--sw-gray-lighter);
}

.sw-multi-actions {
    margin-top: 8px;
}

/* ========================================================================
   Analysis
   ======================================================================== */

.sw-analysis {
    text-align: center;
    padding: 80px 0;
}

.sw-analysis-spinner {
    margin-bottom: 32px;
}

.sw-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border, #e8e6df);
    border-top-color: var(--sw-green);
    border-radius: 50%;
    margin: 0 auto;
    animation: swSpin 0.8s linear infinite;
}

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

.sw-analysis-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
}

.sw-analysis-text {
    font-size: 15px;
    color: var(--sw-gray-lighter);
    margin-bottom: 24px;
    transition: opacity 0.3s ease;
}

.sw-analysis-progress {
    max-width: 300px;
    height: 6px;
    background: var(--border, #e8e6df);
    border-radius: 3px;
    overflow: hidden;
    margin: 0 auto;
}

.sw-analysis-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--sw-green), var(--sw-green-light));
    border-radius: 3px;
    transition: width 0.5s ease;
    width: 0%;
}

/* ========================================================================
   Results
   ======================================================================== */

.sw-results-header {
    text-align: center;
    margin-bottom: 32px;
}

.sw-results-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.sw-results-subtitle {
    font-size: 16px;
    color: var(--sw-gray-light);
}

/* Warnings */
.sw-warning {
    padding: 16px 20px;
    border-radius: var(--sw-radius-sm);
    margin-bottom: 16px;
    font-size: 15px;
    line-height: 1.5;
}

.sw-warning-medication {
    background: var(--sw-amber-bg);
    border: 1px solid var(--sw-amber-border);
    color: var(--sw-amber-text);
}

.sw-warning-pregnancy {
    background: var(--sw-blue-bg);
    border: 1px solid var(--sw-blue-border);
    color: var(--sw-red);
}

/* Sections */
.sw-section {
    margin-bottom: 32px;
}

.sw-section-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Badges */
.sw-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sw-badge-core {
    background: var(--sw-green-bg);
    color: var(--sw-red);
    border: 1px solid var(--sw-green-border);
}

.sw-badge-recommended {
    background: var(--sw-blue-bg);
    color: var(--sw-red);
    border: 1px solid var(--sw-blue-border);
}

.sw-badge-optional {
    background: var(--sw-gray-bg);
    color: var(--sw-gray-light);
    border: 1px solid var(--border, #e8e6df);
}

/* Cards Grid */
.sw-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Product Cards */
.sw-card {
    border: 2px solid var(--border, #e8e6df);
    border-radius: var(--sw-radius);
    padding: 20px;
    background: var(--sw-white);
    transition: all var(--sw-transition);
}

.sw-card:hover {
    box-shadow: var(--sw-shadow);
}

.sw-card-core {
    border-color: var(--sw-green-border);
    background: var(--sw-green-bg);
}

.sw-card-recommended {
    border-color: var(--sw-blue-border);
}

.sw-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 8px;
}

.sw-card-info {
    flex: 1;
}

.sw-card-name {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 2px;
}

.sw-card-subtitle {
    font-size: 13px;
    color: var(--sw-gray-lighter);
    margin: 0;
}

.sw-card-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--sw-green);
    white-space: nowrap;
    text-align: right;
}

.sw-price-uvp {
    font-size: 14px;
    font-weight: 400;
    color: var(--sw-gray-lighter);
    text-decoration: line-through;
    display: block;
    line-height: 1.2;
}

.sw-price-vk {
    color: var(--sw-green);
}

.sw-card-desc {
    font-size: 14px;
    color: var(--sw-gray-light);
    line-height: 1.5;
    margin-bottom: 10px;
}

.sw-card-dose {
    font-size: 14px;
    margin-bottom: 10px;
}

.sw-card-dose-label {
    font-weight: 600;
}

.sw-card-dose-note {
    color: var(--sw-gray-lighter);
    font-style: italic;
}

/* Tags */
.sw-card-reasons {
    margin-bottom: 12px;
    font-size: 13px;
}

.sw-card-reasons-label {
    color: var(--sw-gray-lighter);
}

.sw-card-reasons-tags {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.sw-tag {
    display: inline-block;
    padding: 2px 8px;
    background: var(--sw-gray-bg);
    border-radius: 4px;
    font-size: 12px;
    color: var(--sw-gray-light);
}

.sw-tag-more {
    background: var(--border, #e8e6df);
    font-weight: 600;
}

/* Detail Toggle */
.sw-card-toggle {
    background: none;
    border: none;
    color: var(--sw-blue);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0;
    transition: color var(--sw-transition);
}

.sw-card-toggle:hover {
    color: var(--sw-red);
}

/* Detail Panel */
.sw-card-detail {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    padding: 0;
}

.sw-detail-open {
    max-height: 600px;
    padding-top: 16px;
    border-top: 1px solid var(--border, #e8e6df);
    margin-top: 12px;
}

.sw-detail-section {
    margin-bottom: 12px;
}

.sw-detail-section h4 {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--sw-gray-lighter);
    margin-bottom: 4px;
}

.sw-detail-section p {
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

/* ========================================================================
   Daily Plan
   ======================================================================== */

.sw-daily-plan {
    margin: 32px 0;
}

.sw-plan-table {
    border: 1px solid var(--border, #e8e6df);
    border-radius: var(--sw-radius);
    overflow: hidden;
}

.sw-plan-row {
    display: flex;
    border-bottom: 1px solid var(--border, #e8e6df);
    background: var(--sw-white);
}

.sw-plan-row:last-child {
    border-bottom: none;
}

.sw-plan-row:nth-child(even) {
    background: var(--sw-gray-bg);
}

.sw-plan-time {
    width: 180px;
    flex-shrink: 0;
    padding: 14px 16px;
    font-weight: 700;
    font-size: 14px;
    color: var(--sw-gray);
    background: var(--surface-2);
    border-right: 1px solid var(--border, #e8e6df);
    display: flex;
    align-items: center;
}

.sw-plan-items {
    flex: 1;
    padding: 10px 16px;
}

.sw-plan-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    font-size: 14px;
}

.sw-plan-product {
    color: var(--sw-gray);
}

.sw-plan-amount {
    color: var(--sw-gray-lighter);
    font-weight: 600;
    white-space: nowrap;
    margin-left: 12px;
}

/* ========================================================================
   Cost
   ======================================================================== */

.sw-cost {
    background: var(--sw-gray-bg);
    border-radius: var(--sw-radius);
    padding: 20px;
    margin-bottom: 24px;
    text-align: center;
}

.sw-cost-row {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}

.sw-cost-label {
    font-size: 15px;
    color: var(--sw-gray-light);
}

.sw-cost-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--sw-green);
}

.sw-cost-note {
    font-size: 13px;
    color: var(--sw-gray-lighter);
    margin-top: 4px;
}

/* ========================================================================
   Actions
   ======================================================================== */

.sw-actions {
    text-align: center;
    margin: 32px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

/* ========================================================================
   Disclaimer
   ======================================================================== */

.sw-disclaimer {
    background: var(--sw-gray-bg);
    border-radius: var(--sw-radius-sm);
    padding: 16px 20px;
    margin-top: 24px;
    margin-bottom: 40px;
}

.sw-disclaimer p {
    font-size: 13px;
    color: var(--sw-gray-lighter);
    line-height: 1.6;
    margin: 0;
}

/* ========================================================================
   Mobile Responsive
   ======================================================================== */

@media (max-width: 640px) {

    .supplement-wizard {
        margin: 20px auto;
        padding: 0 var(--page-gutter, 20px);
    }

    .sw-intro {
        padding: 40px 0 20px;
    }

    .sw-intro-title {
        font-size: 22px;
    }

    .sw-intro-text {
        font-size: 15px;
    }

    .sw-question-title {
        font-size: 20px;
    }

    .sw-option {
        padding: 14px 16px;
        font-size: 15px;
    }

    .sw-results-title {
        font-size: 22px;
    }

    .sw-plan-row {
        flex-direction: column;
    }

    .sw-plan-time {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border, #e8e6df);
        padding: 10px 16px;
    }

    .sw-card-header {
        flex-direction: column;
        gap: 8px;
    }

    .sw-card-price {
        font-size: 16px;
    }

    .sw-cost-row {
        flex-direction: column;
        gap: 4px;
    }

    .sw-btn-lg {
        font-size: 15px;
        padding: 14px 24px;
        width: 100%;
    }
}

@media (max-width: 380px) {

    .sw-intro-title {
        font-size: 20px;
    }

    .sw-question-title {
        font-size: 18px;
    }

    .sw-option {
        padding: 12px 14px;
        font-size: 14px;
    }
}
