/* ============================================
   SwitchYourEnergy V3 — Modern Design System
   ============================================ */

/* Design Tokens */
:root {
    --sye-primary: #1E3A5F;
    --sye-secondary: #10B981;
    --sye-accent: #6366F1;
    --sye-surface: #F8FAFC;
    --sye-background: #F0F4F8;
    --sye-background-end: #E2E8F0;
    --sye-success: #10B981;
    --sye-warning: #F59E0B;
    --sye-error: #EF4444;
    --sye-text-primary: #0F172A;
    --sye-text-secondary: #64748B;
    --sye-card-bg: #FFFFFF;
    --sye-border-radius: 12px;
    --sye-border-radius-lg: 16px;
    --sye-border-radius-xl: 24px;
    --sye-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --sye-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --sye-shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.1);
    --sye-shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.12);
    --sye-transition: 0.2s ease;
    --sye-transition-slow: 0.3s ease;
}

/* ============================================
   Animations
   ============================================ */

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(30, 58, 95, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(30, 58, 95, 0);
    }
}

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

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes checkmark {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* ============================================
   Global Transitions
   ============================================ */

.card-hover {
    transition: transform var(--sye-transition), box-shadow var(--sye-transition);
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--sye-shadow-lg);
}

.step-enter {
    animation: fadeInUp 0.4s ease;
}

.fade-in-up {
    animation: fadeInUp 0.5s ease;
}

.scale-in {
    animation: scaleIn 0.3s ease;
}

/* ============================================
   Focus States (Accessibility)
   ============================================ */

:focus-visible {
    outline: 2px solid var(--sye-primary);
    outline-offset: 2px;
}

/* ============================================
   Modern Scrollbar
   ============================================ */

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

::-webkit-scrollbar-track {
    background: var(--sye-surface);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

/* ============================================
   Skeleton Loader
   ============================================ */

.skeleton {
    background: linear-gradient(90deg, #E2E8F0 25%, #F1F5F9 50%, #E2E8F0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--sye-border-radius);
}

.skeleton-card {
    height: 80px;
    margin-bottom: 12px;
    border-radius: var(--sye-border-radius-lg);
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
    width: 60%;
}

.skeleton-text-sm {
    height: 10px;
    margin-bottom: 6px;
    width: 40%;
}

/* ============================================
   Step Wizard — Connected Horizontal Stepper
   ============================================ */

.modern-stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px 20px;
    background: var(--sye-card-bg);
    border-radius: var(--sye-border-radius-lg);
    border-bottom: 3px solid var(--sye-surface);
    position: relative;
}

.modern-stepper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--sye-primary), var(--sye-secondary));
    border-radius: 0 0 var(--sye-border-radius-lg) var(--sye-border-radius-lg);
    transition: width var(--sye-transition-slow);
}

.step-item {
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1;
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    transition: all var(--sye-transition-slow);
    flex-shrink: 0;
}

.step-circle--completed {
    background: var(--sye-secondary);
    color: white;
}

.step-circle--active {
    background: var(--sye-primary);
    color: white;
    animation: pulse 2s ease-in-out infinite;
}

.step-circle--upcoming {
    background: transparent;
    color: var(--sye-text-secondary);
    border: 2px solid #CBD5E1;
}

.step-connector {
    width: 40px;
    height: 2px;
    margin: 0 4px;
    transition: background var(--sye-transition-slow);
    flex-shrink: 0;
}

.step-connector--completed {
    background: var(--sye-secondary);
}

.step-connector--upcoming {
    background: #CBD5E1;
}

.step-label {
    font-size: 0.75rem;
    color: var(--sye-text-secondary);
    margin-left: 8px;
    font-weight: 500;
    white-space: nowrap;
    transition: color var(--sye-transition);
}

.step-label--active {
    color: var(--sye-primary);
    font-weight: 600;
}

/* ============================================
   Quote Page Container
   ============================================ */

.quote-page-bg {
    background: linear-gradient(180deg, var(--sye-background) 0%, var(--sye-background-end) 100%);
    min-height: 100vh;
    padding-top: 16px;
    padding-bottom: 32px;
}

.quote-card {
    border-radius: var(--sye-border-radius-xl) !important;
    box-shadow: var(--sye-shadow-lg) !important;
    animation: fadeInUp 0.5s ease;
    overflow: hidden;
}

.quote-card-header {
    background: linear-gradient(135deg, var(--sye-primary), #2D4A73);
    color: white;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.quote-card-header h2 {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    margin: 0;
}

.quote-card-header .tagline {
    font-size: 0.85rem;
    opacity: 0.85;
    margin: 0;
}

/* ============================================
   Quote Row Cards
   ============================================ */

.quote-row-card {
    background: var(--sye-card-bg);
    border-radius: var(--sye-border-radius-lg);
    box-shadow: var(--sye-shadow-sm);
    padding: 16px 20px;
    margin-bottom: 12px;
    transition: transform var(--sye-transition), box-shadow var(--sye-transition);
    border: 1px solid #E2E8F0;
}

.quote-row-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--sye-shadow-md);
}

.quote-row-card--cheapest {
    background: #F0FDF4;
    border: 2px solid transparent;
    background-clip: padding-box;
    position: relative;
}

.quote-row-card--cheapest::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: calc(var(--sye-border-radius-lg) + 2px);
    background: linear-gradient(135deg, var(--sye-secondary), #14B8A6);
    z-index: -1;
}

.best-price-badge {
    position: absolute;
    top: -1px;
    right: 16px;
    background: linear-gradient(135deg, var(--sye-secondary), #14B8A6);
    color: white;
    padding: 4px 12px;
    border-radius: 0 0 8px 8px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.supplier-logo-frame {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    background: var(--sye-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    flex-shrink: 0;
}

.supplier-logo-frame img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.year-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

.annual-cost {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--sye-primary);
}

.annual-cost-label {
    font-size: 0.75rem;
    color: var(--sye-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quote-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 500;
}

.quote-badge--dd {
    background: #EFF6FF;
    color: #2563EB;
}

.quote-badge--green {
    background: #F0FDF4;
    color: #16A34A;
}

/* Staggered entrance animation for quote cards */
.quote-stagger-1 { animation: staggerIn 0.4s ease both; animation-delay: 0ms; }
.quote-stagger-2 { animation: staggerIn 0.4s ease both; animation-delay: 50ms; }
.quote-stagger-3 { animation: staggerIn 0.4s ease both; animation-delay: 100ms; }
.quote-stagger-4 { animation: staggerIn 0.4s ease both; animation-delay: 150ms; }
.quote-stagger-5 { animation: staggerIn 0.4s ease both; animation-delay: 200ms; }
.quote-stagger-6 { animation: staggerIn 0.4s ease both; animation-delay: 250ms; }
.quote-stagger-7 { animation: staggerIn 0.4s ease both; animation-delay: 300ms; }
.quote-stagger-8 { animation: staggerIn 0.4s ease both; animation-delay: 350ms; }
.quote-stagger-9 { animation: staggerIn 0.4s ease both; animation-delay: 400ms; }
.quote-stagger-10 { animation: staggerIn 0.4s ease both; animation-delay: 450ms; }

/* ============================================
   Filter Pills
   ============================================ */

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 10;
    background: inherit;
}

.filter-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border-radius: 9999px;
    font-size: 0.825rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--sye-transition);
    border: 1.5px solid #CBD5E1;
    background: var(--sye-card-bg);
    color: var(--sye-text-secondary);
    user-select: none;
}

.filter-pill:hover {
    border-color: var(--sye-primary);
    color: var(--sye-primary);
}

.filter-pill--active {
    background: var(--sye-primary);
    border-color: var(--sye-primary);
    color: white;
}

.filter-pill--active:hover {
    background: #163252;
    color: white;
}

.filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--sye-primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    margin-left: 8px;
}

/* ============================================
   Meter List Cards
   ============================================ */

.meter-card {
    background: var(--sye-card-bg);
    border-radius: var(--sye-border-radius);
    border: 1px solid #E2E8F0;
    padding: 16px;
    margin-bottom: 10px;
    transition: all var(--sye-transition);
    animation: fadeInUp 0.4s ease;
}

.meter-card:hover {
    box-shadow: var(--sye-shadow-md);
    border-color: #CBD5E1;
}

.meter-status--quoted {
    color: var(--sye-success);
}

.meter-status--unquoted {
    color: var(--sye-warning);
}

.meter-total-bar {
    background: linear-gradient(135deg, var(--sye-primary), #2D4A73);
    color: white;
    border-radius: var(--sye-border-radius);
    padding: 16px 24px;
    margin-top: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.meter-total-bar .total-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

.meter-total-bar .total-amount {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
}

/* ============================================
   Modern Form Fields
   ============================================ */

.modern-form .mud-input-control {
    margin-bottom: 16px;
}

.modern-form .mud-input {
    border-radius: 8px !important;
}

.modern-form .mud-input-outlined .mud-input-outlined-border {
    border-radius: 8px !important;
}

.modern-form .mud-input:focus-within {
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.15);
}

/* ============================================
   Grey Paper (Modern)
   ============================================ */

.grey-paper-modern {
    background-color: var(--sye-surface);
    border-radius: var(--sye-border-radius-lg);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.04);
}

/* ============================================
   Instructions Component
   ============================================ */

.step-instructions {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
    padding-left: 8px;
}

.step-instructions .instruction-text {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--sye-text-primary);
}

.step-instructions .instruction-subtitle {
    font-size: 0.875rem;
    color: var(--sye-text-secondary);
    margin-top: 2px;
}

/* ============================================
   Company Detail Card
   ============================================ */

.company-detail-card {
    background: var(--sye-card-bg);
    border: 1px solid #E2E8F0;
    border-radius: var(--sye-border-radius-lg);
    padding: 24px;
    animation: scaleIn 0.3s ease;
}

/* ============================================
   Choice Panel Cards (Contract Step)
   ============================================ */

.choice-panel {
    border-radius: var(--sye-border-radius-lg);
    padding: 24px;
    transition: all var(--sye-transition);
    cursor: pointer;
    border: 2px solid #E2E8F0;
    background: var(--sye-card-bg);
}

.choice-panel:hover {
    transform: translateY(-2px);
    box-shadow: var(--sye-shadow-md);
}

.choice-panel--selected {
    border-color: var(--sye-primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.15);
}

.choice-panel .choice-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

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

.wizard-btn {
    border-radius: 9999px !important;
    font-weight: 600;
    text-transform: none;
    transition: all var(--sye-transition);
    padding: 6px 24px;
}

.wizard-btn:hover:not(:disabled) {
    transform: translateY(-2px);
}

.wizard-btn--prev {
    background: transparent;
    color: var(--sye-text-secondary);
    border: 1.5px solid #CBD5E1;
}

.wizard-btn--prev:hover:not(:disabled) {
    border-color: var(--sye-primary);
    color: var(--sye-primary);
}

.wizard-btn--next {
    background: var(--sye-primary);
    color: white;
}

.wizard-btn--next:hover:not(:disabled) {
    background: #163252;
    box-shadow: var(--sye-shadow-md);
}

.wizard-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ============================================
   Search Control (Hero Style)
   ============================================ */

.hero-search {
    background: var(--sye-card-bg);
    border-radius: var(--sye-border-radius-lg);
    padding: 4px;
    box-shadow: var(--sye-shadow-md);
    border: 1.5px solid #E2E8F0;
    transition: border-color var(--sye-transition), box-shadow var(--sye-transition);
}

.hero-search:focus-within {
    border-color: var(--sye-primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.15), var(--sye-shadow-md);
}

/* ============================================
   Alert Components
   ============================================ */

.modern-alert {
    border-radius: var(--sye-border-radius) !important;
    border-left: 4px solid;
}

.modern-alert--error {
    border-left-color: var(--sye-error);
}

.modern-alert--warning {
    border-left-color: var(--sye-warning);
}

.modern-alert--info {
    border-left-color: var(--sye-accent);
}

.modern-alert--success {
    border-left-color: var(--sye-success);
}

/* ============================================
   Tooltip Styling
   ============================================ */

.mud-tooltip {
    border-radius: 8px !important;
    max-width: 300px;
}

/* ============================================
   Loading States
   ============================================ */

.loading-text {
    font-size: 0.925rem;
    color: var(--sye-text-secondary);
    animation: pulse 2s ease-in-out infinite;
}

/* Pulsing dots for wait spinner */
.pulsing-dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.pulsing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--sye-primary);
    animation: pulse 1.4s ease-in-out infinite;
}

.pulsing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.pulsing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

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

@media (max-width: 599px) {
    .modern-stepper {
        padding: 16px 8px 12px;
    }

    .step-connector {
        width: 20px;
    }

    .step-circle {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }

    .quote-row-card {
        padding: 12px 16px;
    }

    .supplier-logo-frame {
        width: 56px;
        height: 56px;
    }

    .annual-cost {
        font-size: 1.25rem;
    }

    .quote-card-header {
        padding: 16px;
    }

    .quote-card-header h2 {
        font-size: 1.1rem;
    }

    .filter-bar {
        gap: 6px;
    }

    .filter-pill {
        padding: 4px 12px;
        font-size: 0.775rem;
    }
}

@media (min-width: 600px) and (max-width: 959px) {
    .step-connector {
        width: 30px;
    }
}
