:root {
    /* Color Palette */
    --primary: #FF6B6B;
    /* Coral Red */
    --primary-hover: #EE5253;
    --secondary: #4ECDC4;
    /* Soft Teal */
    --accent: #fbdf55;
    /* Soft Yellow */
    --dark: #2D3436;
    /* Dark Slate */
    --gray: #636e72d7;
    /* Grey text */
    --bg: #F7F9FC;
    /* Light Blueish Grey Background */
    --white: #ffffffdd;

    /* Shadows */
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.12);

    /* Spacing & Radius */
    --radius-lg: 20px;
    --radius-xl: 30px;
    --radius-round: 50px;

    /* Typography */
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Nunito', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg);
    color: var(--dark);
    line-height: 1.6;
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

/* App Container */
#app {
    width: 100%;
    max-width: 480px;
    /* Mobile First View */
    background: var(--white);
    min-height: 100vh;
    position: relative;
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

@media (min-width: 500px) {
    #app {
        min-height: 90vh;
        margin: auto;
        border-radius: var(--radius-xl);
        max-height: 900px;
        overflow-y: auto;
    }
}

/* Typography */
h1,
h2,
h3 {
    font-family: var(--font-heading);
    color: var(--dark);
}

/* Buttons */
button {
    cursor: pointer;
    border: none;
    outline: none;
    font-family: var(--font-heading);
}

.btn-primary {
    background-color: var(--primary);
    color: var(--white);
    width: 100%;
    padding: 16px;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: var(--radius-round);
    box-shadow: 0 8px 15px rgba(255, 107, 107, 0.3);
    transition: transform 0.2s, background 0.2s;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    background-color: var(--white);
    color: var(--primary);
    border: 2px solid var(--primary);
    width: 100%;
    padding: 14px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: var(--radius-round);
    transition: transform 0.2s, background 0.2s;
}

.btn-secondary:active {
    transform: scale(0.98);
}

.footer-group {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 15px;
    width: 100%;
}

.btn-back {
    background: transparent;
    font-size: 1.5rem;
    padding: 10px;
    color: var(--dark);
}

/* Language Toggle */
.lang-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
    background: var(--white);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: var(--shadow-sm);
    color: var(--dark);
}

/* Steps Layout */
.step {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 20px;
    animation: fadeIn 0.4s ease-out;
}

.step-content {
    flex: 1;
    padding: 20px 0;
}

.scrollable {
    overflow-y: auto;
}

header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-bottom: 10px;
}

header h2 {
    font-size: 1.4rem;
}

.step-desc {
    color: var(--gray);
    margin-bottom: 30px;
}

/* Step 0: Home */
#step-0 .centered {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    height: 100%;
}

.hero-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

/* Step 1: Style Cards */
.card-grid {
    display: grid;
    gap: 20px;
}

.style-card {
    background: var(--white);
    border: 2px solid transparent;
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.style-card.selected {
    border-color: var(--primary);
    background-color: #FFF0F0;
}

.style-card .card-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.style-card h3 {
    margin-bottom: 5px;
}

.style-card p {
    font-size: 0.9rem;
    color: var(--gray);
    line-height: 1.4;
}

.check-mark {
    position: absolute;
    top: 20px;
    right: 20px;
    color: var(--primary);
    font-weight: bold;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s;
}

.style-card.selected .check-mark {
    opacity: 1;
    transform: scale(1);
}

/* Step 2: Quantity */
.counter-widget {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 40px;
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.btn-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-size: 2rem;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.count-display {
    text-align: center;
}

.count-display span {
    display: block;
    font-size: 3rem;
    font-weight: 800;
    font-family: var(--font-heading);
    line-height: 1;
}

.count-display small {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 700;
    letter-spacing: 1px;
}

/* Step 3: Chemistry - Sliders */
.slider-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.slider-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.slider-header .icon {
    font-size: 1.5rem;
    margin-right: 15px;
}

.val-badge {
    margin-left: auto;
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--secondary);
}

.unit {
    color: var(--secondary);
    font-size: 0.9rem;
    margin-left: 2px;
}

/* Custom Range Input */
input[type=range] {
    width: 100%;
    -webkit-appearance: none;
    background: transparent;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 24px;
    width: 24px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    margin-top: -10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: #E0E0E0;
    border-radius: 2px;
}

/* Step 3: Chemistry - Form Grid */
.input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.input-box {
    background: var(--white);
    padding: 18px 12px;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Temperature spans both columns */
.input-box:nth-child(3) {
    grid-column: span 2;
}

.input-box label {
    display: block;
    font-size: 0.85rem;
    color: var(--gray);
    margin-bottom: 12px;
    white-space: nowrap;
    font-weight: 700;
}

.input-box input {
    width: 45px;
    border: none;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 800;
    font-family: var(--font-heading);
    color: var(--dark);
    outline: none;
    background: transparent;
}

/* Mini Counter Layout */
.mini-counter-input {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.btn-mini {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #F1F2F6;
    color: var(--gray);
    font-size: 1.4rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.1s;
}

.btn-mini:active {
    background: #E1E2E6;
    transform: scale(0.95);
}

/* Hide spin buttons */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
}

/* Toggle Group */
.toggle-group {
    display: flex;
    background: #EEE;
    border-radius: var(--radius-round);
    padding: 5px;
    margin-bottom: 40px;
}

.toggle-group button {
    flex: 1;
    padding: 10px;
    border-radius: var(--radius-round);
    background: transparent;
    color: var(--gray);
    font-weight: 600;
    transition: all 0.2s;
}

.toggle-group button.selected {
    background: var(--white);
    color: var(--primary);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Step 4: Redesigned Results */
.results-header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.header-content {
    text-align: center;
    flex: 1;
}

.header-content h2 {
    font-size: 1.3rem;
    margin-bottom: 2px;
}

.res-summary-text {
    font-size: 0.8rem;
    color: var(--gray);
    font-weight: 600;
}

.pizza-visual {
    display: flex;
    justify-content: center;
    margin: 20px 0 30px;
}

.pizza-art {
    font-size: 6rem;
    animation: float 4s ease-in-out infinite;
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.1));
}

/* Colorful Ingredients Grid */
.ingredients-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.ing-card-colorful {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    border-radius: var(--radius-xl);
    color: white;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s;
}

.ing-card-colorful:hover {
    transform: translateY(-2px);
}

.ing-icon-circle {
    background: rgba(255, 255, 255, 0.25);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-right: 20px;
    backdrop-filter: blur(5px);
}

.ing-name {
    font-size: 1.2rem;
    font-weight: 700;
    opacity: 0.95;
    flex: 1;
    /* Pushes amount to right */
}

.ing-amount {
    font-size: 1.8rem;
    font-weight: 800;
}

.ing-amount small {
    font-size: 1rem;
    margin-left: 2px;
    opacity: 0.8;
}

/* Gradients */
.bg-flour {
    background: linear-gradient(135deg, #a55eea, #8854d0);
    box-shadow: 0 10px 20px rgba(136, 84, 208, 0.3);
}

.bg-water {
    background: linear-gradient(135deg, #4ECDC4, #2bcbba);
    box-shadow: 0 10px 20px rgba(43, 203, 186, 0.3);
}

/* Small Row for Salt/Yeast/Oil */
.ing-row {
    display: flex;
    gap: 15px;
}

.ing-row .ing-card-colorful {
    flex: 1;
    flex-direction: column;
    padding: 15px;
    text-align: center;
    align-items: center;
    justify-content: center;
}

.ing-row .ing-icon-circle {
    margin-right: 0;
    margin-bottom: 8px;
    width: 35px;
    height: 35px;
    font-size: 1.2rem;
}

.ing-name-small {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 5px;
    opacity: 0.9;
}

.ing-amount-small {
    font-size: 1.4rem;
    font-weight: 800;
}

.ing-amount-small small {
    font-size: 0.8rem;
    opacity: 0.8;
}

.bg-yeast {
    background: linear-gradient(135deg, #ffb8b8, #ff7675);
    box-shadow: 0 8px 15px rgba(255, 118, 117, 0.3);
}

/* Adjusted yeast color to be more reddish/coral, similar to reference "Yeast" card */

.bg-salt {
    background: linear-gradient(135deg, #fdcb6e, #e17055);
    box-shadow: 0 8px 15px rgba(225, 112, 85, 0.3);
}

/* Salt/Classic Orange-ish */

.bg-oil {
    background: linear-gradient(135deg, #badc58, #6ab04c);
    box-shadow: 0 8px 15px rgba(106, 176, 76, 0.3);
}

/* Timing Card */
.timing-card {
    background: var(--white);
    border: 2px dashed #E0E0E0;
    border-radius: var(--radius-xl);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.timing-icon {
    font-size: 1.5rem;
    background: #FFF5E6;
    /* Light orange bg */
    color: #F39C12;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
}

.timing-text {
    display: flex;
    flex-direction: column;
}

.timing-text strong {
    color: var(--dark);
    font-size: 1rem;
}

.timing-text span {
    color: var(--gray);
    font-size: 0.85rem;
}

.section-title {
    font-size: 1rem;
    margin: 20px 0 10px;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 1px;
}


/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}