/* ===========================================
   BATTERY SIMULATOR - DUAL THEME STYLES
   Inspired by Lovable Design System
   =========================================== */

/* Google Fonts - Already loaded in HTML */

/* CSS Variables - Dark Theme (Default) */
:root {
    /* Primary Colors */
    --background: hsl(0 0% 7%);
    --foreground: hsl(0 0% 98%);

    --card: hsl(0 0% 10%);
    --card-foreground: hsl(0 0% 98%);

    --primary: hsl(142 100% 50%);
    --primary-foreground: hsl(0 0% 7%);

    --secondary: hsl(0 0% 15%);
    --secondary-foreground: hsl(0 0% 98%);

    --muted: hsl(0 0% 18%);
    --muted-foreground: hsl(0 0% 60%);

    --border: hsl(0 0% 20%);
    --input: hsl(0 0% 15%);

    --destructive: hsl(0 84% 60%);
    --success: hsl(142 100% 50%);

    /* Energy Colors */
    --energy-green: hsl(142 100% 50%);
    --energy-glow: hsl(142 100% 50% / 0.3);

    /* Gradients */
    --gradient-energy: linear-gradient(135deg, hsl(142 100% 50%) 0%, hsl(142 80% 40%) 100%);
    --gradient-card: linear-gradient(180deg, hsl(0 0% 12%) 0%, hsl(0 0% 8%) 100%);
    --gradient-glow: radial-gradient(ellipse at center, hsl(142 100% 50% / 0.15) 0%, transparent 70%);

    /* Shadows */
    --shadow-glow: 0 0 60px hsl(142 100% 50% / 0.3);
    --shadow-card: 0 25px 50px -12px hsl(0 0% 0% / 0.5);
    --shadow-button: 0 10px 40px hsl(142 100% 50% / 0.4);

    /* Card backgrounds with alpha */
    --card-bg: hsl(0 0% 10% / 0.8);
    --card-border: hsl(0 0% 20% / 0.5);
    --modal-bg: hsl(0 0% 10% / 0.95);
    --overlay-bg: hsl(0 0% 0% / 0.8);

    /* ROI item backgrounds */
    --roi-item-bg: hsl(0 0% 15%);
    --roi-highlight-bg: hsl(142 100% 50% / 0.15);
    --roi-highlight-border: hsl(142 100% 50% / 0.4);

    /* Logo filter for dark theme */
    --logo-filter: brightness(0) invert(1);

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-xxl: 48px;

    /* Border radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 30px;
    --radius-2xl: 1rem;
    --radius-full: 50%;
}

/* CSS Variables - Light Theme */
[data-theme="light"] {
    --background: hsl(0 0% 97%);
    --foreground: hsl(0 0% 10%);

    --card: hsl(0 0% 100%);
    --card-foreground: hsl(0 0% 10%);

    --primary: hsl(142 100% 50%);
    --primary-foreground: hsl(0 0% 100%);

    --secondary: hsl(0 0% 95%);
    --secondary-foreground: hsl(0 0% 10%);

    --muted: hsl(0 0% 92%);
    --muted-foreground: hsl(0 0% 45%);

    --border: hsl(0 0% 88%);
    --input: hsl(0 0% 100%);

    /* Gradients for light theme */
    --gradient-energy: linear-gradient(135deg, hsl(142 100% 50%) 0%, hsl(142 80% 40%) 100%);
    --gradient-card: linear-gradient(180deg, hsl(0 0% 100%) 0%, hsl(0 0% 98%) 100%);

    /* Shadows for light theme */
    --shadow-glow: 0 0 40px hsl(142 100% 50% / 0.2);
    --shadow-card: 0 10px 40px -10px hsl(0 0% 0% / 0.1);
    --shadow-button: 0 8px 30px hsl(142 100% 50% / 0.3);

    /* Card backgrounds */
    --card-bg: hsl(0 0% 100% / 0.9);
    --card-border: hsl(0 0% 88% / 0.8);
    --modal-bg: hsl(0 0% 100% / 0.98);
    --overlay-bg: hsl(0 0% 0% / 0.5);

    /* ROI item backgrounds for light theme */
    --roi-item-bg: hsl(0 0% 85%);
    --roi-highlight-bg: hsl(142 100% 50% / 0.12);
    --roi-highlight-border: hsl(142 100% 50% / 0.35);

    /* Logo filter for light theme (no filter needed) */
    --logo-filter: none;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    border-color: var(--border);
}

html, body {
    min-height: 100vh;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
    position: relative;
    overflow-x: hidden;
}

/* Green ambient glow on sides - Dark theme */
body::before,
body::after {
    content: '';
    position: fixed;
    top: 0;
    width: 40%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

body::before {
    left: 0;
    background: radial-gradient(ellipse at left center, hsl(142 100% 50% / 0.15) 0%, transparent 60%);
}

body::after {
    right: 0;
    background: radial-gradient(ellipse at right center, hsl(142 100% 50% / 0.15) 0%, transparent 60%);
}

/* Green ambient glow - Light theme */
[data-theme="light"] body::before {
    background: radial-gradient(ellipse at left center, hsl(142 100% 50% / 0.15) 0%, transparent 60%);
}

[data-theme="light"] body::after {
    background: radial-gradient(ellipse at right center, hsl(142 100% 50% / 0.15) 0%, transparent 60%);
}

/* ===========================================
   ANIMATIONS
   =========================================== */

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

@keyframes fadeUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 40px hsl(142 100% 50% / 0.3);
        opacity: 1;
    }
    50% {
        box-shadow: 0 0 80px hsl(142 100% 50% / 0.5);
        opacity: 0.8;
    }
}

@keyframes fillBattery {
    0% { height: 10%; }
    50% { height: 90%; }
    100% { height: 10%; }
}

@keyframes fillBatteryOnce {
    0% { height: 0%; }
    100% { height: var(--fill-percent, 100%); }
}

@keyframes particle {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) scale(0);
        opacity: 0;
    }
}

@keyframes energyFlow {
    0% {
        transform: translateY(100%) scaleY(0.5);
        opacity: 0.5;
    }
    50% {
        transform: translateY(0%) scaleY(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-100%) scaleY(0.5);
        opacity: 0.5;
    }
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

@keyframes countUp {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Animation utility classes */
.animate-fade-up {
    animation: fadeUp 0.6s ease-out forwards;
}

.animate-scale-in {
    animation: scaleIn 0.5s ease-out forwards;
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-pulse-glow {
    animation: pulseGlow 2s ease-in-out infinite;
}

.animate-pulse {
    animation: pulse 2s ease-in-out infinite;
}

.animate-energy-flow {
    animation: energyFlow 1.5s ease-in-out infinite;
}

/* ===========================================
   GLASS CARD COMPONENTS
   =========================================== */

.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

.glass-card-hover {
    background: var(--card-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: all 0.5s ease;
}

.glass-card-hover:hover {
    border-color: hsl(142 100% 50% / 0.3);
    box-shadow: var(--shadow-glow);
}

/* ===========================================
   HEADER STYLES
   =========================================== */

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) var(--spacing-xl);
    background: var(--card-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background 0.3s ease, border-color 0.3s ease;
    position: relative;
}

.back-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--primary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.back-link:hover {
    opacity: 0.8;
    transform: translateX(-4px);
}

.back-arrow {
    font-size: 1.1rem;
}

.logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.logo-img {
    height: 32px;
    width: auto;
    display: block;
    filter: var(--logo-filter);
    transition: filter 0.3s ease;
}

.header-spacer {
    width: 150px;
}

/* Theme Toggle Button */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--muted);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.theme-toggle:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: scale(1.05);
}

.theme-toggle:hover .theme-icon {
    transform: rotate(15deg);
}

.theme-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    line-height: 1;
}

.theme-icon svg {
    width: 20px;
    height: 20px;
}

/* Hide/show icons based on theme */
.theme-icon-sun {
    display: none;
}

.theme-icon-moon {
    display: block;
}

[data-theme="light"] .theme-icon-sun {
    display: block;
}

[data-theme="light"] .theme-icon-moon {
    display: none;
}

/* ===========================================
   PROGRESS INDICATOR - Lovable Style
   =========================================== */

.progress-indicator {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    padding: var(--spacing-lg) var(--spacing-xl);
    background: transparent;
    position: relative;
    z-index: 1;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    position: relative;
}

.step-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--muted);
    border: 2px solid var(--border);
    transition: all 0.4s ease;
    position: relative;
}

.step-number {
    font-size: 1rem;
    font-weight: 600;
    color: var(--muted-foreground);
    transition: all 0.3s ease;
}

.step-check {
    display: none;
    width: 20px;
    height: 20px;
    color: var(--primary-foreground);
}

.step-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--muted-foreground);
    transition: color 0.3s ease;
}

/* Active step */
.progress-step.active .step-circle {
    background: transparent;
    border-color: var(--primary);
    box-shadow: 0 0 20px hsl(142 100% 50% / 0.3);
}

.progress-step.active .step-number {
    color: var(--primary);
}

.progress-step.active .step-label {
    color: var(--primary);
}

/* Completed step */
.progress-step.completed .step-circle {
    background: var(--primary);
    border-color: var(--primary);
}

.progress-step.completed .step-number {
    display: none;
}

.progress-step.completed .step-check {
    display: block;
}

.progress-step.completed .step-label {
    color: var(--foreground);
}

/* Progress line between steps */
.progress-line {
    width: 60px;
    height: 2px;
    background: var(--border);
    margin-top: 24px;
    transition: background 0.4s ease;
}

.progress-line.completed {
    background: var(--primary);
}

/* ===========================================
   MAIN CONTAINER
   =========================================== */

.simulator-container {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--spacing-xl) var(--spacing-lg);
    flex: 1;
    position: relative;
    z-index: 1;
}

/* View management */
.view {
    display: none;
    animation: fadeUp 0.6s ease-out forwards;
}

.view.active {
    display: block;
}

/* ===========================================
   PAGE TITLE
   =========================================== */

.page-title {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.page-title h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: var(--spacing-sm);
    background: var(--gradient-energy);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.page-title .subtitle {
    font-size: 1rem;
    color: var(--muted-foreground);
}

/* ===========================================
   FORM STYLES - Lovable Style
   =========================================== */

.form-card {
    background: transparent;
    border: none;
    padding: 0;
    box-shadow: none;
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: var(--spacing-md);
}

/* Input wrapper with icon */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
    overflow: hidden;
}

.input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px hsl(142 100% 50% / 0.1);
}

.input-icon {
    position: absolute;
    left: var(--spacing-md);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    color: var(--muted-foreground);
    transition: color 0.3s ease;
}

.input-icon svg {
    width: 20px;
    height: 20px;
}

.input-wrapper:focus-within .input-icon {
    color: var(--primary);
}

.input-info {
    position: absolute;
    right: var(--spacing-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted-foreground);
    cursor: help;
    transition: color 0.3s ease;
}

.input-info svg {
    width: 18px;
    height: 18px;
}

.input-info:hover {
    color: var(--foreground);
}

.form-group input {
    width: 100%;
    padding: var(--spacing-lg) var(--spacing-xl);
    padding-left: calc(var(--spacing-md) + 32px);
    padding-right: calc(var(--spacing-md) + 32px);
    font-size: 1rem;
    background: transparent;
    border: none;
    color: var(--foreground);
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
}

.form-group input::placeholder {
    color: var(--muted-foreground);
}

/* Remove spinner from number inputs */
.form-group input[type="number"]::-webkit-inner-spin-button,
.form-group input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.form-group input[type="number"] {
    -moz-appearance: textfield;
}

.form-footer {
    text-align: center;
    font-size: 0.9rem;
    color: var(--muted-foreground);
    margin-top: var(--spacing-lg);
}

/* ===========================================
   BUTTON STYLES
   =========================================== */

.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    width: 100%;
    padding: var(--spacing-lg) var(--spacing-xl);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-foreground);
    background: var(--primary);
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    box-shadow: var(--shadow-button);
    position: relative;
    overflow: hidden;
}

/* Button glow effect */
.btn-glow {
    box-shadow:
        0 0 20px hsl(142 100% 50% / 0.4),
        0 0 40px hsl(142 100% 50% / 0.2),
        0 0 60px hsl(142 100% 50% / 0.1);
    animation: buttonGlow 2s ease-in-out infinite;
}

@keyframes buttonGlow {
    0%, 100% {
        box-shadow:
            0 0 20px hsl(142 100% 50% / 0.4),
            0 0 40px hsl(142 100% 50% / 0.2),
            0 0 60px hsl(142 100% 50% / 0.1);
    }
    50% {
        box-shadow:
            0 0 30px hsl(142 100% 50% / 0.5),
            0 0 60px hsl(142 100% 50% / 0.3),
            0 0 90px hsl(142 100% 50% / 0.15);
    }
}

.btn-arrow {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.btn-primary:hover {
    transform: scale(1.02);
    box-shadow:
        0 0 30px hsl(142 100% 50% / 0.5),
        0 0 60px hsl(142 100% 50% / 0.3),
        0 0 90px hsl(142 100% 50% / 0.15);
}

.btn-primary:hover .btn-arrow {
    transform: translateX(4px);
}

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

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    animation: none;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--muted-foreground);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-secondary:hover {
    background-color: var(--muted);
    color: var(--foreground);
    border-color: var(--primary);
}

.btn-large {
    padding: var(--spacing-lg) var(--spacing-xl);
    font-size: 1.1rem;
}

/* ===========================================
   LOADING VIEW STYLES - Enhanced Battery Animation
   =========================================== */

.loading-content {
    text-align: center;
    padding: var(--spacing-xxl) var(--spacing-lg);
}

.loading-animation {
    margin-bottom: var(--spacing-xl);
    display: flex;
    justify-content: center;
}

/* Enhanced Battery animation */
.battery-icon {
    position: relative;
    width: 120px;
    height: 200px;
}

.battery-body {
    position: absolute;
    inset: 0;
    border: 4px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--card);
    overflow: hidden;
}

.battery-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: var(--gradient-energy);
    animation: fillBattery 2s ease-in-out infinite;
}

/* Energy waves inside battery */
.battery-fill::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, transparent, hsl(0 0% 100% / 0.2), transparent);
    animation: energyFlow 1.5s ease-in-out infinite;
}

/* Glow effect on battery */
.battery-body::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    box-shadow: inset 0 0 40px hsl(142 100% 50% / 0.2);
    pointer-events: none;
    transition: all 0.3s ease;
}

.battery-tip {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 16px;
    background-color: var(--border);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

/* Percentage display inside battery */
.battery-percentage {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: var(--foreground);
    text-shadow: 0 2px 10px hsl(0 0% 0% / 0.5);
    z-index: 1;
}

/* Particles effect */
.battery-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: var(--radius-lg);
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    animation: particle 2s ease-out infinite;
}

.loading-content h2 {
    font-size: 1.75rem;
    color: var(--foreground);
    margin-bottom: var(--spacing-sm);
}

.loading-content p {
    color: var(--muted-foreground);
    margin-bottom: var(--spacing-xl);
}

/* Loading Steps - Lovable Style */
.loading-steps {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    max-width: 450px;
    margin: 0 auto;
}

.loading-step {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-lg);
    transition: all 0.5s ease;
    background: var(--card);
    border: 1px solid transparent;
    opacity: 0.4;
}

.loading-step.active {
    opacity: 1;
    background: hsl(142 100% 50% / 0.1);
    border-color: hsl(142 100% 50% / 0.3);
}

.loading-step.completed {
    opacity: 1;
    background: var(--card);
    border-color: transparent;
}

.loading-step-indicator {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--muted);
    position: relative;
    flex-shrink: 0;
}

.loading-step-indicator .check-icon {
    display: none;
    width: 18px;
    height: 18px;
    color: var(--primary-foreground);
}

.loading-step-indicator .pulse-dot {
    display: none;
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
}

/* Pending state - gray circle */
.loading-step .pulse-dot {
    display: block;
    background: var(--muted-foreground);
    opacity: 0.5;
}

/* Active state - pulsing green dot */
.loading-step.active .loading-step-indicator {
    background: hsl(142 100% 50% / 0.2);
    border: 2px solid var(--primary);
}

.loading-step.active .pulse-dot {
    display: block;
    background: var(--primary);
    opacity: 1;
    animation: pulseDot 1.5s ease-in-out infinite;
}

.loading-step.active .check-icon {
    display: none;
}

/* Completed state - checkmark */
.loading-step.completed .loading-step-indicator {
    background: var(--primary);
}

.loading-step.completed .check-icon {
    display: block;
}

.loading-step.completed .pulse-dot {
    display: none;
}

.loading-step-text {
    font-size: 0.95rem;
    color: var(--muted-foreground);
    transition: color 0.3s ease;
}

.loading-step.active .loading-step-text {
    color: var(--primary);
    font-weight: 500;
}

.loading-step.completed .loading-step-text {
    color: var(--foreground);
}

@keyframes pulseDot {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.7;
    }
}

/* ===========================================
   RESULTS VIEW STYLES
   =========================================== */

/* Recommended battery card */
.result-card {
    background: var(--card-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-card);
    text-align: center;
    animation: fadeUp 0.6s ease-out forwards;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.result-card.recommended {
    border: 2px solid var(--primary);
    position: relative;
    box-shadow: var(--shadow-glow);
}

.recommended-badge {
    display: inline-block;
    background: var(--gradient-energy);
    color: var(--primary-foreground);
    padding: var(--spacing-xs) var(--spacing-lg);
    border-radius: var(--radius-xl);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.battery-capacity {
    margin-bottom: var(--spacing-sm);
}

.capacity-value {
    font-size: 4rem;
    font-weight: 800;
    background: var(--gradient-energy);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: countUp 1s ease-out forwards;
}

.capacity-unit {
    font-size: 1.5rem;
    color: var(--muted-foreground);
    margin-left: var(--spacing-xs);
}

.main-benefit {
    margin-bottom: var(--spacing-lg);
}

.benefit-value {
    font-size: 2.75rem;
    font-weight: 700;
    color: var(--foreground);
}

.benefit-label {
    font-size: 1rem;
    color: var(--muted-foreground);
}

.metrics-row {
    display: flex;
    justify-content: center;
    gap: var(--spacing-xxl);
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
}

.metric {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-md);
    background: var(--muted);
    border-radius: var(--radius-md);
    min-width: 140px;
}

.metric-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: hsl(142 100% 50% / 0.15);
    border-radius: var(--radius-md);
    color: var(--primary);
}

.metric-icon svg {
    width: 22px;
    height: 22px;
}

.metric-label {
    font-size: 0.85rem;
    color: var(--muted-foreground);
}

.metric-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
}

/* ROI Section */
.roi-section {
    background: var(--muted);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    margin-top: var(--spacing-md);
    text-align: left;
}

.roi-section h3 {
    font-size: 1.1rem;
    margin-bottom: var(--spacing-md);
    color: var(--foreground);
    text-align: center;
}

.roi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
}

.roi-item {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    text-align: center;
    padding: var(--spacing-md);
    background: var(--roi-item-bg);
    border-radius: var(--radius-sm);
    transition: background 0.3s ease;
}

.roi-label {
    font-size: 0.85rem;
    color: var(--muted-foreground);
}

.roi-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--foreground);
}

.roi-item.highlight {
    background: var(--roi-highlight-bg);
    border: 1px solid var(--roi-highlight-border);
}

.roi-item.highlight .roi-value {
    font-size: 1.3rem;
    color: var(--primary);
    font-weight: 700;
}

/* ===========================================
   CHART SECTION
   =========================================== */

.chart-section {
    background: var(--card-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-card);
    animation: fadeUp 0.6s ease-out forwards;
    animation-delay: 0.1s;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.chart-section h2 {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-xs);
    color: var(--foreground);
}

.chart-subtitle {
    color: var(--muted-foreground);
    font-size: 0.9rem;
    margin-bottom: var(--spacing-lg);
}

.chart-container {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    height: 250px;
    padding-top: 25px;
    border-bottom: 2px solid var(--border);
    margin-bottom: var(--spacing-lg);
}

.chart-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    max-width: 100px;
}

.bar-value {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 8px;
    white-space: nowrap;
}

/* Wrapper for the actual bar fills */
.bar-fills-wrapper {
    width: 45px;
    height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background: var(--muted);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.bar-fill {
    width: 100%;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    transition: height 0.5s ease-out;
}

/* Savings bar (at bottom) */
.bar-fill.savings {
    background-color: var(--foreground);
    border-radius: 0;
    order: 2;
}

/* Revenue bar (on top) */
.bar-fill.revenue {
    background-color: var(--primary);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    order: 1;
}

/* For single color bars */
.chart-bar:not(#bar-smart-battery) .bar-fill {
    background-color: var(--foreground);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.bar-label {
    font-size: 0.7rem;
    color: var(--muted-foreground);
    text-align: center;
    margin-top: 8px;
    line-height: 1.3;
    height: 35px;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: var(--spacing-xl);
    padding-top: var(--spacing-md);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.85rem;
    color: var(--muted-foreground);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.legend-color.savings {
    background-color: var(--foreground);
}

.legend-color.revenue {
    background-color: var(--primary);
}

/* ===========================================
   OTHER OPTIONS SECTION
   =========================================== */

.other-options-section {
    margin-bottom: var(--spacing-lg);
    animation: fadeUp 0.6s ease-out forwards;
    animation-delay: 0.2s;
}

.other-options-section h2 {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-lg);
    color: var(--foreground);
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-md);
}

/* Battery option card */
.battery-option-card {
    background: var(--card-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease;
}

.battery-option-card:hover {
    border-color: hsl(142 100% 50% / 0.3);
    box-shadow: var(--shadow-glow);
    transform: translateY(-4px);
}

.battery-option-card.is-recommended {
    border-color: var(--primary);
    position: relative;
}

.battery-option-card.is-recommended::before {
    content: "Recommande";
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gradient-energy);
    color: var(--primary-foreground);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: var(--radius-xl);
}

.option-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.option-capacity {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.option-gain {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--foreground);
}

.option-details {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border);
}

.option-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-lg);
    font-size: 0.85rem;
}

.option-detail .label {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--muted-foreground);
}

.option-detail .detail-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: var(--primary);
    flex-shrink: 0;
}

.option-detail .detail-icon svg {
    width: 16px;
    height: 16px;
}

.option-detail .value {
    font-weight: 500;
    color: var(--foreground);
    flex-shrink: 0;
    text-align: right;
}

/* ===========================================
   CTA SECTION
   =========================================== */

.cta-section {
    background: var(--gradient-energy);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    text-align: center;
    margin-bottom: var(--spacing-lg);
    position: relative;
    overflow: hidden;
    animation: fadeUp 0.6s ease-out forwards;
    animation-delay: 0.3s;
}

/* Subtle glow overlay */
.cta-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, hsl(0 0% 100% / 0.2) 0%, transparent 70%);
    pointer-events: none;
}

.cta-section h2 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-sm);
    color: var(--primary-foreground);
    position: relative;
}

.cta-section p {
    color: hsl(0 0% 7% / 0.8);
    margin-bottom: var(--spacing-lg);
    position: relative;
}

.cta-section .btn-primary {
    background-color: var(--primary-foreground);
    color: var(--foreground);
    max-width: 350px;
    margin: 0 auto;
    position: relative;
    box-shadow: 0 10px 40px hsl(0 0% 0% / 0.3);
}

.cta-section .btn-primary:hover {
    background-color: hsl(0 0% 20%);
    box-shadow: 0 15px 50px hsl(0 0% 0% / 0.4);
}

/* Light theme: lighter hover for CTA button */
[data-theme="light"] .cta-section .btn-primary:hover {
    background-color: hsl(0 0% 90%);
    box-shadow: 0 15px 50px hsl(0 0% 0% / 0.15);
}

/* Restart Section */
.restart-section {
    text-align: center;
    margin-top: var(--spacing-lg);
}

/* ===========================================
   ERROR VIEW STYLES
   =========================================== */

.error-content {
    text-align: center;
    padding: var(--spacing-xxl) var(--spacing-lg);
    background: var(--card-bg);
    backdrop-filter: blur(24px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: background 0.3s ease, border-color 0.3s ease;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-lg);
}

.error-content h2 {
    font-size: 1.5rem;
    color: var(--destructive);
    margin-bottom: var(--spacing-sm);
}

.error-content p {
    color: var(--muted-foreground);
    margin-bottom: var(--spacing-lg);
}

.error-content .btn-primary {
    max-width: 200px;
    margin: 0 auto;
}

/* ===========================================
   FOOTER STYLES
   =========================================== */

.site-footer {
    background: var(--card-bg);
    border-top: 1px solid var(--card-border);
    padding: var(--spacing-lg) var(--spacing-xl);
    text-align: center;
    margin-top: auto;
    transition: background 0.3s ease, border-color 0.3s ease;
    position: relative;
    z-index: 1;
}

.site-footer p {
    font-size: 0.85rem;
    color: var(--muted-foreground);
}

.site-footer a {
    color: var(--muted-foreground);
    text-decoration: none;
    transition: color 0.3s ease;
}

.site-footer a:hover {
    color: var(--primary);
}

/* ===========================================
   MODAL STYLES
   =========================================== */

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--overlay-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-md);
    overflow-y: auto;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--modal-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: var(--spacing-xl);
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
    box-shadow: var(--shadow-card);
}

.modal-close {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    background: var(--muted);
    border: none;
    font-size: 1.5rem;
    color: var(--muted-foreground);
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    transition: all 0.3s ease;
}

.modal-close:hover {
    background-color: var(--border);
    color: var(--foreground);
}

.modal-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.modal-header h2 {
    font-size: 1.5rem;
    color: var(--foreground);
    margin-bottom: var(--spacing-xs);
}

.modal-header p {
    color: var(--muted-foreground);
    font-size: 0.95rem;
}

/* Quote Form */
.quote-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
}

.quote-form .form-group {
    margin-bottom: var(--spacing-md);
}

/* Quote Summary */
.quote-summary {
    background: var(--muted);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.quote-summary h3 {
    font-size: 0.9rem;
    color: var(--muted-foreground);
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-sm);
}

.summary-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.summary-label {
    font-size: 0.8rem;
    color: var(--muted-foreground);
}

.summary-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
}

/* Battery Selection in Modal */
.battery-selection {
    margin-bottom: var(--spacing-lg);
}

.battery-selection h3 {
    font-size: 0.9rem;
    color: var(--muted-foreground);
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.battery-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: var(--spacing-sm);
}

.battery-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
    background: var(--muted);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.battery-option:hover {
    border-color: var(--primary);
    background: hsl(142 100% 50% / 0.1);
}

.battery-option.selected {
    border-color: var(--primary);
    background: hsl(142 100% 50% / 0.15);
    box-shadow: 0 0 20px hsl(142 100% 50% / 0.2);
}

.battery-option.recommended {
    position: relative;
}

.battery-option.recommended::after {
    content: "Recommandé";
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gradient-energy);
    color: var(--primary-foreground);
    font-size: 0.6rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-xl);
    white-space: nowrap;
}

.battery-option-size {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--foreground);
}

.battery-option-unit {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

.battery-option.selected .battery-option-size {
    color: var(--primary);
}

.battery-selection-hint {
    font-size: 0.85rem;
    color: var(--primary);
    margin-top: var(--spacing-sm);
    min-height: 20px;
}

/* Quote Success */
.quote-success {
    text-align: center;
    padding: var(--spacing-xl) 0;
}

.quote-success .success-icon {
    width: 80px;
    height: 80px;
    background: hsl(142 100% 50% / 0.2);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--primary);
    margin: 0 auto var(--spacing-lg);
    animation: scaleIn 0.5s ease-out forwards;
}

.quote-success h2 {
    font-size: 1.5rem;
    color: var(--foreground);
    margin-bottom: var(--spacing-sm);
}

.quote-success p {
    color: var(--muted-foreground);
    margin-bottom: var(--spacing-lg);
}

/* Loading state for submit button */
.btn-primary.loading {
    position: relative;
    color: transparent;
}

.btn-primary.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid var(--primary-foreground);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ===========================================
   CUSTOM SCROLLBAR
   =========================================== */

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background);
}

::-webkit-scrollbar-thumb {
    background: var(--muted);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: hsl(142 100% 50% / 0.5);
}

/* ===========================================
   RESPONSIVE STYLES
   =========================================== */

/* Large Desktop (1200px and up) */
@media (min-width: 1200px) {
    .simulator-container {
        max-width: 1000px;
        padding: var(--spacing-xxl) var(--spacing-xl);
    }

    .page-title h1 {
        font-size: 2.75rem;
    }

    .page-title .subtitle {
        font-size: 1.15rem;
    }

    .progress-indicator {
        padding: var(--spacing-xl);
    }

    .step-circle {
        width: 52px;
        height: 52px;
    }

    .progress-line {
        width: 80px;
    }

    .form-card {
        max-width: 650px;
    }

    .result-card {
        padding: var(--spacing-xxl);
    }

    .capacity-value {
        font-size: 5rem;
    }

    .benefit-value {
        font-size: 3.5rem;
    }

    .chart-container {
        height: 280px;
    }

    .bar-fills-wrapper {
        width: 55px;
        height: 170px;
    }

    .bar-label {
        font-size: 0.8rem;
    }

    .options-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .cta-section {
        padding: var(--spacing-xxl);
    }

    .cta-section h2 {
        font-size: 1.75rem;
    }
}

/* Tablet Landscape and Small Desktop (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    .simulator-container {
        max-width: 900px;
    }

    .options-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablet Portrait (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .simulator-container {
        max-width: 720px;
        padding: var(--spacing-lg) var(--spacing-md);
    }

    .options-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .chart-container {
        height: 240px;
    }

    .bar-fills-wrapper {
        width: 42px;
        height: 130px;
    }

    .bar-label {
        font-size: 0.7rem;
    }
}

/* Mobile Landscape and Large Phones (576px - 767px) */
@media (min-width: 576px) and (max-width: 767px) {
    .site-header {
        padding: var(--spacing-md);
    }

    .logo {
        position: static;
        transform: none;
    }

    .logo-img {
        height: 28px;
    }

    .back-link {
        font-size: 0.9rem;
    }

    .header-spacer {
        display: none;
    }

    .breadcrumb {
        padding: var(--spacing-sm) var(--spacing-md);
        gap: var(--spacing-sm);
    }

    .breadcrumb-item {
        font-size: 0.85rem;
    }

    .simulator-container {
        max-width: 540px;
        padding: var(--spacing-lg) var(--spacing-md);
    }

    .page-title h1 {
        font-size: 1.5rem;
    }

    .page-title .subtitle {
        font-size: 0.95rem;
    }

    .form-card {
        padding: var(--spacing-lg);
    }

    .result-card {
        padding: var(--spacing-lg);
    }

    .capacity-value {
        font-size: 3rem;
    }

    .benefit-value {
        font-size: 2.25rem;
    }

    .metrics-row {
        gap: var(--spacing-lg);
    }

    .metric {
        min-width: 120px;
    }

    .roi-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: var(--spacing-sm);
    }

    .chart-container {
        height: 220px;
    }

    .bar-fills-wrapper {
        width: 36px;
        height: 110px;
    }

    .bar-value {
        font-size: 0.75rem;
    }

    .bar-label {
        font-size: 0.6rem;
    }

    .options-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile Portrait (up to 575px) */
@media (max-width: 575px) {
    .site-header {
        padding: var(--spacing-sm) var(--spacing-md);
        min-height: 56px;
    }

    .logo {
        position: static;
        transform: none;
        order: 0;
    }

    .logo-img {
        height: 24px;
    }

    .back-link {
        order: -1;
        font-size: 0.85rem;
    }

    .back-link span:not(.back-arrow) {
        display: none;
    }

    .back-arrow {
        font-size: 1.2rem;
    }

    .header-spacer {
        display: none;
    }

    /* Progress indicator - Mobile */
    .progress-indicator {
        padding: var(--spacing-md) var(--spacing-sm);
    }

    .step-circle {
        width: 40px;
        height: 40px;
    }

    .step-number {
        font-size: 0.9rem;
    }

    .step-check {
        width: 16px;
        height: 16px;
    }

    .step-label {
        font-size: 0.75rem;
    }

    .progress-line {
        width: 30px;
        margin-top: 20px;
    }

    .simulator-container {
        padding: var(--spacing-md) var(--spacing-sm);
    }

    .page-title {
        margin-bottom: var(--spacing-lg);
    }

    .page-title h1 {
        font-size: 1.5rem;
        line-height: 1.3;
    }

    .page-title .subtitle {
        font-size: 0.9rem;
    }

    /* Form inputs - Mobile */
    .form-card {
        padding: 0;
    }

    .input-wrapper {
        border-radius: var(--radius-md);
    }

    .input-icon svg {
        width: 18px;
        height: 18px;
    }

    .form-group input {
        padding: var(--spacing-md) var(--spacing-lg);
        padding-left: calc(var(--spacing-md) + 28px);
        padding-right: calc(var(--spacing-md) + 28px);
        font-size: 0.95rem;
    }

    .btn-primary {
        padding: var(--spacing-md);
        font-size: 1rem;
    }

    .btn-glow {
        animation: none;
        box-shadow: var(--shadow-button);
    }

    .btn-arrow {
        width: 18px;
        height: 18px;
    }

    .form-footer {
        font-size: 0.85rem;
    }

    /* Loading View - Mobile */
    .loading-content {
        padding: var(--spacing-xl) var(--spacing-md);
    }

    .loading-content h1 {
        font-size: 1.35rem;
    }

    .loading-content p {
        font-size: 0.9rem;
    }

    .battery-icon {
        width: 100px;
        height: 160px;
    }

    .battery-percentage {
        font-size: 1.5rem;
    }

    .battery-tip {
        width: 35px;
        height: 14px;
        top: -11px;
    }

    /* Loading steps - Mobile */
    .loading-steps {
        max-width: 100%;
    }

    .loading-step {
        padding: var(--spacing-sm) var(--spacing-md);
        border-radius: var(--radius-md);
    }

    .loading-step-indicator {
        width: 32px;
        height: 32px;
    }

    .loading-step-indicator .check-icon {
        width: 16px;
        height: 16px;
    }

    .loading-step-text {
        font-size: 0.85rem;
    }

    /* Results View */
    .result-card {
        padding: var(--spacing-md);
        border-radius: var(--radius-md);
    }

    .result-card.recommended {
        border-width: 2px;
    }

    .recommended-badge {
        font-size: 0.8rem;
        padding: var(--spacing-xs) var(--spacing-md);
    }

    .capacity-value {
        font-size: 2.5rem;
    }

    .capacity-unit {
        font-size: 1.2rem;
    }

    .benefit-value {
        font-size: 1.75rem;
    }

    .benefit-label {
        font-size: 0.9rem;
    }

    .metrics-row {
        flex-direction: column;
        gap: var(--spacing-md);
    }

    .metric {
        min-width: 100%;
    }

    .metric-label {
        font-size: 0.8rem;
    }

    .metric-value {
        font-size: 1.1rem;
    }

    .roi-section {
        padding: var(--spacing-md);
    }

    .roi-section h3 {
        font-size: 1rem;
    }

    .roi-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    .roi-item {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .roi-label {
        font-size: 0.8rem;
    }

    .roi-value {
        font-size: 1rem;
    }

    .roi-item.highlight .roi-value {
        font-size: 1.1rem;
    }

    /* Chart Section */
    .chart-section {
        padding: var(--spacing-md);
        border-radius: var(--radius-md);
    }

    .chart-section h2 {
        font-size: 1.1rem;
    }

    .chart-subtitle {
        font-size: 0.85rem;
    }

    .chart-container {
        height: 200px;
    }

    .bar-fills-wrapper {
        width: 30px;
        height: 95px;
    }

    .bar-value {
        font-size: 0.65rem;
        margin-bottom: 5px;
    }

    .bar-label {
        font-size: 0.55rem;
        margin-top: 5px;
        height: 30px;
    }

    .chart-legend {
        gap: var(--spacing-md);
        flex-wrap: wrap;
    }

    .legend-item {
        font-size: 0.7rem;
    }

    .legend-color {
        width: 10px;
        height: 10px;
    }

    /* Other Options */
    .other-options-section h2 {
        font-size: 1.1rem;
        margin-bottom: var(--spacing-md);
    }

    .options-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }

    .battery-option-card {
        padding: var(--spacing-md);
        border-radius: var(--radius-md);
    }

    .option-capacity {
        font-size: 1.3rem;
    }

    .option-gain {
        font-size: 1rem;
    }

    .option-detail {
        font-size: 0.8rem;
    }

    /* CTA Section */
    .cta-section {
        padding: var(--spacing-lg) var(--spacing-md);
        border-radius: var(--radius-md);
    }

    .cta-section h2 {
        font-size: 1.25rem;
    }

    .cta-section p {
        font-size: 0.9rem;
    }

    /* Error View */
    .error-content {
        padding: var(--spacing-xl) var(--spacing-md);
    }

    .error-icon {
        font-size: 3rem;
    }

    .error-content h2 {
        font-size: 1.25rem;
    }

    /* Footer */
    .site-footer {
        padding: var(--spacing-md);
    }

    .site-footer p {
        font-size: 0.75rem;
        line-height: 1.5;
    }

    /* Modal */
    .modal-overlay {
        padding: var(--spacing-sm);
        align-items: flex-start;
        padding-top: var(--spacing-md);
    }

    .modal-content {
        padding: var(--spacing-md);
        margin: 0;
        border-radius: var(--radius-md);
    }

    .modal-header {
        margin-bottom: var(--spacing-md);
    }

    .modal-header h2 {
        font-size: 1.15rem;
    }

    .modal-header p {
        font-size: 0.85rem;
    }

    .quote-form .form-row {
        grid-template-columns: 1fr;
    }

    .quote-form .form-group label {
        font-size: 0.85rem;
    }

    .quote-summary {
        padding: var(--spacing-sm);
    }

    .quote-summary h3 {
        font-size: 0.8rem;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .summary-label {
        font-size: 0.75rem;
    }

    .summary-value {
        font-size: 0.9rem;
    }

    .quote-success h2 {
        font-size: 1.25rem;
    }

    .quote-success .success-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
}

/* Very Small Phones (up to 359px) */
@media (max-width: 359px) {
    .site-header {
        padding: var(--spacing-xs) var(--spacing-sm);
    }

    .logo-img {
        height: 20px;
    }

    .breadcrumb {
        flex-direction: column;
        gap: var(--spacing-xs);
    }

    .breadcrumb-separator {
        display: none;
    }

    .breadcrumb-item {
        font-size: 0.75rem;
    }

    .simulator-container {
        padding: var(--spacing-sm);
    }

    .page-title h1 {
        font-size: 1.2rem;
    }

    .page-title .subtitle {
        font-size: 0.85rem;
    }

    .form-card,
    .result-card,
    .chart-section,
    .cta-section {
        padding: var(--spacing-sm);
    }

    .capacity-value {
        font-size: 2rem;
    }

    .benefit-value {
        font-size: 1.5rem;
    }

    .chart-container {
        height: 180px;
    }

    .bar-fills-wrapper {
        width: 24px;
        height: 80px;
    }

    .bar-value {
        font-size: 0.5rem;
    }

    .bar-label {
        font-size: 0.45rem;
        height: 28px;
    }

    .chart-legend {
        gap: var(--spacing-sm);
    }

    .legend-item {
        font-size: 0.6rem;
    }
}

/* ===========================================
   UTILITY CLASSES
   =========================================== */

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

.text-gradient {
    background: var(--gradient-energy);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.energy-glow {
    box-shadow: var(--shadow-glow);
}

.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mb-xl { margin-bottom: var(--spacing-xl); }

/* ===========================================
   FORM LABELS AND INFO TOOLTIPS
   =========================================== */

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--foreground);
    margin-bottom: var(--spacing-xs);
}

.form-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-xs);
}

.form-label-row .form-label {
    margin-bottom: 0;
}

/* Info tooltip button */
.form-label-row .input-info {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted-foreground);
    cursor: help;
    transition: color 0.3s ease;
}

.form-label-row .input-info svg {
    width: 18px;
    height: 18px;
}

.form-label-row .input-info:hover {
    color: var(--primary);
}

/* Tooltip popup */
.form-label-row .input-info::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    width: 280px;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--foreground);
    line-height: 1.5;
    box-shadow: var(--shadow-card);
    opacity: 0;
    visibility: hidden;
    transform: translateY(5px);
    transition: all 0.2s ease;
    z-index: 100;
    pointer-events: none;
}

.form-label-row .input-info::after {
    content: '';
    position: absolute;
    bottom: calc(100% + 3px);
    right: 6px;
    border: 6px solid transparent;
    border-top-color: var(--border);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 101;
}

.form-label-row .input-info:hover::before,
.form-label-row .input-info:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ===========================================
   BATTERY SELECTION IN RESULTS
   =========================================== */

.selection-hint {
    font-size: 0.9rem;
    color: var(--muted-foreground);
    margin-bottom: var(--spacing-md);
    text-align: center;
}

.selection-status {
    font-size: 0.9rem;
    color: var(--primary);
    margin-top: var(--spacing-md);
    text-align: center;
    min-height: 24px;
    font-weight: 500;
}

/* Selectable battery cards */
.battery-option-card {
    cursor: pointer;
}

.battery-option-card.selected {
    border-color: var(--primary);
    background: hsl(142 100% 50% / 0.08);
    box-shadow: 0 0 30px hsl(142 100% 50% / 0.2);
}

.battery-option-card.selected::after {
    content: "Sélectionné";
    position: absolute;
    top: -12px;
    right: var(--spacing-md);
    background: var(--primary);
    color: var(--primary-foreground);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-xl);
}

/* ===========================================
   CONSENT CHECKBOX STYLING
   =========================================== */

.consent-group {
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    cursor: pointer;
    position: relative;
    padding-left: 32px;
    line-height: 1.5;
}

.checkbox-container input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 2px;
    left: 0;
    height: 22px;
    width: 22px;
    background-color: var(--muted);
    border: 2px solid var(--border);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.checkbox-container:hover .checkmark {
    border-color: var(--primary);
}

.checkbox-container input:checked ~ .checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid var(--primary-foreground);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}

.consent-text {
    font-size: 0.85rem;
    color: var(--muted-foreground);
}

.consent-text a {
    color: var(--primary);
    text-decoration: underline;
}

.consent-text a:hover {
    color: var(--foreground);
}

.consent-error {
    color: var(--destructive);
    font-size: 0.85rem;
    margin-top: var(--spacing-xs);
    padding-left: 32px;
}

/* Mobile adjustments for consent */
@media (max-width: 575px) {
    .consent-text {
        font-size: 0.8rem;
    }

    .checkbox-container {
        padding-left: 28px;
    }

    .checkmark {
        height: 20px;
        width: 20px;
    }

    .checkmark:after {
        left: 5px;
        top: 1px;
    }

    .consent-error {
        padding-left: 28px;
    }

    .form-label-row .input-info::before {
        width: 220px;
        right: -50px;
    }
}
