/* =============================================
   Calculadora BARF — Estilos Premium
   Mobile-first · Paleta clínica veterinaria
   ============================================= */

/* ---------- DESIGN TOKENS ---------- */
:root {
    --color-bg: #f4f7f6;
    --color-surface: #ffffff;
    --color-text: #1e293b;
    --color-text-muted: #64748b;
    --color-primary: #3ecfa5;
    /* verde menta */
    --color-primary-dark: #2bb78e;
    --color-primary-light: #d1fae5;
    --color-accent: #60a5fa;
    /* azul suave */
    --color-border: #e2e8f0;
    --color-shadow: rgba(30, 41, 59, .06);

    /* result card colours */
    --meat-color: #ef4444;
    --bone-color: #f59e0b;
    --liver-color: #8b5cf6;
    --organ-color: #06b6d4;

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --shadow-card: 0 4px 24px var(--color-shadow);
    --shadow-btn: 0 2px 12px rgba(62, 207, 165, .35);
    --transition: .25s cubic-bezier(.4, 0, .2, 1);
}

/* ---------- RESET & BASE ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
}

.container {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- HERO ---------- */
.hero {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a3a 100%);
    color: #fff;
    padding: 56px 0 48px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: -50%;
    left: -25%;
    width: 150%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(62, 207, 165, .15) 0%, transparent 70%);
    pointer-events: none;
}

.hero__badge {
    display: inline-block;
    background: rgba(62, 207, 165, .15);
    color: var(--color-primary);
    font-weight: 600;
    font-size: .8rem;
    padding: 6px 16px;
    border-radius: 100px;
    margin-bottom: 20px;
    letter-spacing: .02em;
}

.hero__title {
    font-size: clamp(1.6rem, 5vw, 2.4rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
}

.hero__highlight {
    color: var(--color-primary);
}

.hero__subtitle {
    font-size: .95rem;
    color: rgba(255, 255, 255, .7);
    max-width: 440px;
    margin: 0 auto;
    line-height: 1.55;
}

/* ---------- AD SLOTS ---------- */
.adsense-slot {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef2f1;
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-muted);
    font-size: .8rem;
    font-weight: 500;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.adsense-slot--banner {
    height: 90px;
    margin: 24px auto;
}

.adsense-slot--square {
    height: 260px;
    margin: 32px auto 40px;
}

/* ---------- CALCULATOR CARD ---------- */
.calculator-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    padding: 32px 24px;
    margin-top: 8px;
}

.form-group {
    margin-bottom: 32px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-weight: 600;
    font-size: .9rem;
    margin-bottom: 14px;
    color: var(--color-text);
}

/* Input row: slider + number + unit toggle */
.input-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.input-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* --- Slider (iOS-style) --- */
.slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: var(--color-border);
    border-radius: 100px;
    outline: none;
    transition: background var(--transition);
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--color-primary);
    box-shadow: 0 2px 8px rgba(62, 207, 165, .4);
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition);
}

.slider::-webkit-slider-thumb:hover,
.slider::-webkit-slider-thumb:active {
    transform: scale(1.15);
    box-shadow: 0 4px 16px rgba(62, 207, 165, .55);
}

.slider::-moz-range-thumb {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: var(--color-primary);
    box-shadow: 0 2px 8px rgba(62, 207, 165, .4);
    cursor: pointer;
}

/* --- Number input (iOS-style) --- */
.input-number-wrap {
    position: relative;
}

.input-number {
    width: 100%;
    padding: 14px 16px;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--color-text);
    background: var(--color-bg);
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    -moz-appearance: textfield;
    appearance: textfield;
}

.input-number::-webkit-inner-spin-button,
.input-number::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.input-number:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(62, 207, 165, .18);
}

/* --- Unit toggle (iOS segmented control) --- */
.unit-toggle {
    display: flex;
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    padding: 4px;
    gap: 2px;
    flex-shrink: 0;
    align-self: flex-end;
}

.unit-btn {
    font-family: inherit;
    font-size: .85rem;
    font-weight: 600;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all var(--transition);
}

.unit-btn--active {
    background: var(--color-surface);
    color: var(--color-text);
    box-shadow: 0 1px 4px var(--color-shadow);
}

/* ---------- ACTIVITY CARDS ---------- */
.activity-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.activity-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 18px 10px;
    background: var(--color-bg);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    color: var(--color-text);
    text-align: center;
    -webkit-tap-highlight-color: transparent;
}

.activity-card:hover {
    border-color: var(--color-primary-light);
    transform: translateY(-2px);
}

.activity-card--active {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
    box-shadow: 0 0 0 3px rgba(62, 207, 165, .15);
}

.activity-card__icon {
    font-size: 1.6rem;
}

.activity-card__name {
    font-weight: 700;
    font-size: .9rem;
}

.activity-card__detail {
    font-size: .72rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

/* ---------- PRINT SUMMARY (hidden on screen, shown in print) ---------- */
.print-summary {
    display: none;
}

/* ---------- RESULTS SECTION ---------- */
.results {
    margin-top: 32px;
    text-align: center;
    animation: fadeUp .5s ease both;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results__heading {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.results__total {
    font-size: 1rem;
    color: var(--color-text-muted);
    margin-bottom: 24px;
}

.results__total strong {
    color: var(--color-primary-dark);
    font-size: 1.3rem;
    font-weight: 800;
}

/* Result cards */
.results-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.result-card {
    background: var(--color-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: 18px 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    transition: transform var(--transition);
}

.result-card:hover {
    transform: translateY(-2px);
}

.result-card__icon {
    font-size: 1.5rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}

/* Coloured icon backgrounds */
.result-card--meat .result-card__icon {
    background: #fef2f2;
}

.result-card--bone .result-card__icon {
    background: #fffbeb;
}

.result-card--liver .result-card__icon {
    background: #f5f3ff;
}

.result-card--organ .result-card__icon {
    background: #ecfeff;
}

.result-card__info {
    flex: 1;
    display: flex;
    flex-direction: column;
    text-align: left;
    min-width: 100px;
}

.result-card__label {
    font-weight: 600;
    font-size: .9rem;
}

.result-card__percent {
    font-size: .75rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

.result-card__value {
    font-size: 1.25rem;
    font-weight: 800;
    white-space: nowrap;
}

.result-card--meat .result-card__value {
    color: var(--meat-color);
}

.result-card--bone .result-card__value {
    color: var(--bone-color);
}

.result-card--liver .result-card__value {
    color: var(--liver-color);
}

.result-card--organ .result-card__value {
    color: var(--organ-color);
}

/* Mini progress bar */
.result-card__bar {
    width: 100%;
    height: 5px;
    background: var(--color-bg);
    border-radius: 100px;
    overflow: hidden;
}

.result-card__fill {
    height: 100%;
    border-radius: 100px;
    transition: width .6s ease;
}

.result-card--meat .result-card__fill {
    background: var(--meat-color);
}

.result-card--bone .result-card__fill {
    background: var(--bone-color);
}

.result-card--liver .result-card__fill {
    background: var(--liver-color);
}

.result-card--organ .result-card__fill {
    background: var(--organ-color);
}

/* ---------- PRINT BUTTON ---------- */
.btn-print {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 28px;
    padding: 16px 36px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border: none;
    border-radius: 100px;
    cursor: pointer;
    box-shadow: var(--shadow-btn);
    transition: transform var(--transition), box-shadow var(--transition);
    -webkit-tap-highlight-color: transparent;
}

.btn-print:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(62, 207, 165, .45);
}

.btn-print:active {
    transform: scale(.97);
}

/* ---------- FOOTER ---------- */
.footer {
    text-align: center;
    padding: 32px 20px 40px;
    font-size: .8rem;
    color: var(--color-text-muted);
}

/* ---------- PRINT STYLES ---------- */
@media print {

    /* Force browsers to print background colours */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Kill all animations so nothing is invisible */
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }

    body {
        background: #fff;
    }

    /* Simplified header */
    .hero {
        background: #fff !important;
        color: #000 !important;
        padding: 20px 0 8px;
    }

    .hero::after {
        display: none !important;
    }

    .hero__title {
        font-size: 1.3rem;
        color: #000;
    }

    .hero__highlight {
        color: var(--color-primary-dark);
    }

    /* Hide UI-only elements */
    .hero__badge,
    .hero__subtitle,
    .adsense-slot,
    .calculator-card,
    .btn-print,
    .footer {
        display: none !important;
    }

    /* Show print-only summary with dog data */
    .print-summary {
        display: block !important;
        text-align: center;
        font-size: .95rem;
        color: #333;
        margin-bottom: 12px;
        padding: 12px 0;
        border-bottom: 1px solid #e0e0e0;
    }

    .print-summary strong {
        color: #000;
    }

    .print-date {
        font-size: .8rem;
        color: #888;
        margin-top: 4px;
    }

    /* Results */
    .results {
        margin-top: 0;
        text-align: center;
    }

    .results__heading {
        font-size: 1.1rem;
        margin-bottom: 4px;
    }

    .results__total strong {
        color: var(--color-primary-dark);
    }

    /* Result cards — clean, bordered, with colours preserved */
    .result-card {
        box-shadow: none;
        border: 1.5px solid #ddd;
        border-radius: 10px;
        break-inside: avoid;
        page-break-inside: avoid;
        margin-bottom: 8px;
    }

    .result-card:hover {
        transform: none;
    }

    /* Keep icon backgrounds */
    .result-card__icon {
        background: #f5f5f5 !important;
    }

    /* Keep coloured values */
    .result-card--meat .result-card__value {
        color: var(--meat-color) !important;
    }

    .result-card--bone .result-card__value {
        color: var(--bone-color) !important;
    }

    .result-card--liver .result-card__value {
        color: var(--liver-color) !important;
    }

    .result-card--organ .result-card__value {
        color: var(--organ-color) !important;
    }

    /* Keep fill bar colours */
    .result-card--meat .result-card__fill {
        background: var(--meat-color) !important;
    }

    .result-card--bone .result-card__fill {
        background: var(--bone-color) !important;
    }

    .result-card--liver .result-card__fill {
        background: var(--liver-color) !important;
    }

    .result-card--organ .result-card__fill {
        background: var(--organ-color) !important;
    }

    .result-card__bar {
        background: #eee !important;
    }

    /* Ensure container is full width for paper */
    .container {
        max-width: 100%;
        padding: 0 24px;
    }
}

/* ---------- RESPONSIVE ≥ 480px ---------- */
@media (min-width: 480px) {
    .container {
        padding: 0 28px;
    }

    .calculator-card {
        padding: 36px 32px;
    }
}