/* ================================================================
   SOLAR FORM — Design épuré · Orange #f66836
   Seules les règles impossibles à faire en Tailwind sont ici.
   ================================================================ */

/* ── Variables CSS (référencées par le JS) ── */
.sf-widget {
    --sf-orange:       #f66836;
    --sf-orange-hover: #e05a29;
    --sf-orange-glow:  rgba(246, 104, 54, 0.20);
    --sf-orange-tint:  rgba(246, 104, 54, 0.08);
    --sf-text:         #ffffff;
    --sf-text-muted:   rgba(255, 255, 255, 0.48);
    --sf-border:       rgba(255, 255, 255, 0.07);
    --sf-card-bg:      rgba(255, 255, 255, 0.04);

    background: #141008;
    border-radius: 20px;
    border: 1px solid rgba(246, 104, 54, 0.10);
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255,255,255,0.03) inset;
    padding: 36px 28px 28px;
    color: #fff;
    position: relative;
    overflow: visible;
    width: 100%;
    box-sizing: border-box;
    min-height: 480px;
}

/* Isolation contre Tailwind Preflight */
.sf-widget *,
.sf-widget *::before,
.sf-widget *::after {
    box-sizing: border-box;
}

.sf-widget button,
.sf-widget input,
.sf-widget ul,
.sf-widget li {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
}

.sf-widget button {
    cursor: pointer;
}

.sf-widget > * {
    position: relative;
    z-index: 1;
}

/* Suppression des styles hérités de .form-card */
.form-card--solar {
    padding: 0;
    background: transparent;
    box-shadow: none;
    border: none;
    backdrop-filter: none;
    overflow: visible;
}

/* ── Header accroche ── */
.sf-header {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sf-header-title {
    font-size: clamp(1rem, 3.5vw, 1.3rem);
    font-weight: 700;
    color: #fff;
    margin: 0 0 6px;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.sf-highlight {
    color: var(--sf-orange);
}

.sf-header-subtitle {
    font-size: 0.7rem;
    color: var(--sf-text-muted);
    margin: 0;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 600;
}

/* ── Barre de progression ── */
.sf-progress {
    display: flex;
    gap: 6px;
    margin-bottom: 32px;
}

.sf-progress-segment {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 2px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.sf-progress-segment.active {
    background: var(--sf-orange);
}

/* ── Steps ── */
.sf-step {
    animation: sfFadeUp 0.24s ease both;
}

.sf-hidden {
    display: none !important;
}

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

/* ── Typographie ── */
.sf-title {
    font-size: clamp(1.25rem, 5vw, 1.75rem);
    font-weight: 700;
    color: #fff;
    margin: 0 0 12px;
    line-height: 1.2;
    text-align: center;
    letter-spacing: -0.02em;
}

.sf-subtitle {
    color: var(--sf-text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    margin: 0 0 22px;
    text-align: center;
}

.sf-subtitle-center {
    color: var(--sf-text-muted);
    font-size: 0.70rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    margin: 0 0 14px;
    text-align: center;
}

/* ── Étape 1 · Adresse ── */
.sf-address-wrapper {
    position: relative;
    margin-bottom: 6px;
}

.sf-address-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.10);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: clamp(12px, 3vw, 16px) 48px clamp(12px, 3vw, 16px) clamp(14px, 3vw, 20px);
    font-size: clamp(0.875rem, 3vw, 1rem);
    color: #fff;
    outline: none;
    box-sizing: border-box;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
    font-weight: 500;
}

.sf-address-input:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
}

.sf-address-input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--sf-orange);
    box-shadow: 0 0 0 4px rgba(246, 104, 54, 0.20);
}

.sf-address-input::placeholder {
    color: rgba(255, 255, 255, 0.50);
}

/* Suggestions dropdown */
.sf-address-wrapper {
    position: relative;
}

.sf-suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
    z-index: 200;
    list-style: none;
    margin: 0;
    padding: 4px 0;
}
.sf-suggestions:empty {
    display: none;
}

.sf-suggestion-item {
    padding: 13px 18px;
    cursor: pointer;
    color: #1e293b;
    font-size: 0.875rem;
    font-weight: 400;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.1s;
    line-height: 1.4;
}

.sf-suggestion-item:last-child {
    border-bottom: none;
}

.sf-suggestion-item:hover {
    background: #fff7f4;
}

.sf-suggestion-item strong {
    color: var(--sf-orange);
    font-weight: 700;
}

.sf-suggestion-main {
    display: block;
    font-weight: 600;
    color: #1e293b;
    font-size: 0.875rem;
}

.sf-suggestion-secondary {
    display: block;
    font-size: 0.775rem;
    color: #94a3b8;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Masquer le dropdown natif Google Places */
.pac-container {
    display: none !important;
}

.sf-suggestion-loading {
    display: flex;
    justify-content: center;
    padding: 14px;
}

/* Carte */
.sf-map-container {
    border-radius: 12px;
    overflow: hidden;
    width: 100%;
    height: 240px;
    background: rgba(255, 255, 255, 0.03);
    margin-bottom: 14px;
    border: 1px solid var(--sf-border);
}

.sf-map-placeholder--idle {
    display: flex !important;
    border: 1.5px dashed rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.18);
    gap: 10px;
}

.sf-map-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sf-map-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.78rem;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
}

.sf-map-placeholder-icon {
    font-size: 1.8rem;
}

/* ── Étape 2 · Type de projet ── */
.sf-choice-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.sf-choice-card {
    background: var(--sf-card-bg);
    border: 1.5px solid var(--sf-border);
    border-radius: 14px;
    padding: 22px 14px;
    cursor: pointer;
    color: #fff;
    text-align: center;
    transition: border-color 0.18s, background 0.18s, transform 0.14s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-family: inherit;
    min-height: 115px;
}

.sf-choice-card:hover {
    border-color: rgba(246, 104, 54, 0.40);
    background: var(--sf-orange-tint);
    transform: translateY(-2px);
}

.sf-choice-card.selected {
    border-color: var(--sf-orange);
    background: var(--sf-orange-tint);
    box-shadow: 0 0 0 1px var(--sf-orange);
}

.sf-choice-svg {
    width: 30px;
    height: 30px;
    stroke: rgba(255, 255, 255, 0.40);
    fill: none;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke 0.18s;
    flex-shrink: 0;
}

.sf-choice-card.selected .sf-choice-svg {
    stroke: var(--sf-orange);
}

.sf-choice-card strong {
    font-size: 0.9rem;
    font-weight: 700;
    display: block;
}

.sf-choice-card small {
    font-size: 0.68rem;
    color: var(--sf-text-muted);
    line-height: 1.5;
    display: block;
}

/* ── Sections (groupes visuels avec label) ── */
.sf-section {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    padding: 16px 16px 18px;
    margin-bottom: 10px;
}

.sf-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: rgba(255, 255, 255, 0.30);
    margin-bottom: 14px;
    text-align: center;
}

/* ── Étape 3 · Boussole ── */
.sf-compass {
    display: flex;
    justify-content: center;
    margin: 0 auto;
}

/* grid-template-areas — impossible en Tailwind */
.sf-compass-grid {
    display: grid;
    grid-template-areas:
        "no n  ne"
        "o  c  e"
        "so s  se";
    gap: 10px;
}

.sf-compass-btn {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid rgba(255, 255, 255, 0.09);
    color: rgba(255, 255, 255, 0.48);
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s, transform 0.1s;
    font-family: inherit;
    letter-spacing: 0.02em;
}

.sf-compass-btn[data-dir="NO"] { grid-area: no; }
.sf-compass-btn[data-dir="N"]  { grid-area: n;  }
.sf-compass-btn[data-dir="NE"] { grid-area: ne; }
.sf-compass-btn[data-dir="O"]  { grid-area: o;  }
.sf-compass-btn[data-dir="E"]  { grid-area: e;  }
.sf-compass-btn[data-dir="SO"] { grid-area: so; }
.sf-compass-btn[data-dir="S"]  { grid-area: s;  }
.sf-compass-btn[data-dir="SE"] { grid-area: se; }

.sf-compass-btn:hover {
    border-color: rgba(246, 104, 54, 0.50);
    color: var(--sf-orange);
    transform: scale(1.08);
}

.sf-compass-btn.selected {
    background: var(--sf-orange);
    border-color: var(--sf-orange);
    color: #fff;
    transform: scale(1.1);
}

.sf-compass-center {
    grid-area: c;
    width: 54px;
    height: 54px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sf-compass-dot {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.38);
    border-radius: 50%;
    position: relative;
    z-index: 2;
}

/* transform-origin non standard → custom CSS */
.sf-compass-arrow {
    position: absolute;
    bottom: 50%;
    left: 50%;
    width: 2px;
    height: 18px;
    margin-left: -1px;
    background: linear-gradient(to top, transparent 0%, var(--sf-orange) 40%, var(--sf-orange) 100%);
    transform-origin: 50% 100%;
    transform: rotate(0deg);
    border-radius: 2px 2px 0 0;
    display: none;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sf-compass-arrow.visible {
    display: block;
}

/* ── Sliders ── */
.sf-slider-value {
    font-size: clamp(2.2rem, 7vw, 3rem);
    font-weight: 700;
    color: #fff;
    text-align: center;
    margin-bottom: 10px;
    line-height: 1;
    letter-spacing: -0.03em;
}

.sf-slider-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.sf-slider-label {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.28);
    white-space: nowrap;
    min-width: 36px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.sf-slider-label:last-child {
    text-align: right;
}

/* Range input — webkit/moz pseudo-elements requis */
.sf-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 5px;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.sf-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 0 2px var(--sf-orange);
    cursor: pointer;
    border: none;
    transition: transform 0.15s;
}

.sf-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.sf-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: 2px solid var(--sf-orange);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ── Grande valeur (étapes 4 & 5) ── */
.sf-big-value {
    font-size: clamp(3.4rem, 12vw, 5rem);
    font-weight: 700;
    color: #fff;
    text-align: center;
    margin: 4px 0;
    line-height: 1;
    letter-spacing: -0.04em;
}

.sf-section .sf-big-value {
    margin: 0 0 12px;
}

.sf-section .sf-slider-wrapper {
    margin-bottom: 0;
}

.sf-big-value.sf-orange {
    color: var(--sf-orange);
}

.sf-unit {
    font-size: 0.38em;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.48);
    vertical-align: middle;
    letter-spacing: 0;
}

.sf-orange .sf-unit {
    color: rgba(246, 104, 54, 0.60);
}

/* Tags */
.sf-consumption-tags,
.sf-install-tags {
    display: flex;
    gap: 7px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.sf-tag {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 99px;
    padding: 5px 14px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.72);
    font-weight: 700;
    letter-spacing: 0.01em;
}

/* ── Étape 5 · Graphique ── */
.sf-chart-wrapper {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 14px 12px 8px;
    margin: 0 0 10px;
}

.sf-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 85px;
    margin-bottom: 6px;
}

/* transform-origin: bottom requis pour l'animation scaleY */
.sf-chart-bar {
    flex: 1;
    background: var(--sf-orange);
    border-radius: 4px 4px 0 0;
    cursor: pointer;
    position: relative;
    transform-origin: bottom;
    animation: sfBarGrow 0.5s ease both;
    transition: filter 0.15s;
    min-height: 4px;
}

.sf-chart-bar:hover {
    filter: brightness(1.2);
}

/* nth-child delays — impossible en Tailwind */
.sf-chart-bar:nth-child(1)  { animation-delay: 0.02s; }
.sf-chart-bar:nth-child(2)  { animation-delay: 0.05s; }
.sf-chart-bar:nth-child(3)  { animation-delay: 0.08s; }
.sf-chart-bar:nth-child(4)  { animation-delay: 0.11s; }
.sf-chart-bar:nth-child(5)  { animation-delay: 0.14s; }
.sf-chart-bar:nth-child(6)  { animation-delay: 0.17s; }
.sf-chart-bar:nth-child(7)  { animation-delay: 0.20s; }
.sf-chart-bar:nth-child(8)  { animation-delay: 0.23s; }
.sf-chart-bar:nth-child(9)  { animation-delay: 0.26s; }
.sf-chart-bar:nth-child(10) { animation-delay: 0.29s; }
.sf-chart-bar:nth-child(11) { animation-delay: 0.32s; }
.sf-chart-bar:nth-child(12) { animation-delay: 0.35s; }

@keyframes sfBarGrow {
    from { transform: scaleY(0); opacity: 0; }
    to   { transform: scaleY(1); opacity: 1; }
}

/* Tooltip */
.sf-chart-tooltip {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.96);
    color: #1e293b;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.12s;
    z-index: 10;
    text-align: center;
}

.sf-chart-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: rgba(255, 255, 255, 0.96);
}

.sf-chart-bar:hover .sf-chart-tooltip {
    opacity: 1;
}

.sf-chart-labels {
    display: flex;
    gap: 4px;
}

.sf-chart-labels span {
    flex: 1;
    text-align: center;
    font-size: 0.56rem;
    color: rgba(255, 255, 255, 0.28);
    font-weight: 600;
    letter-spacing: 0.02em;
}

.sf-savings-25y {
    text-align: center;
    font-size: 0.78rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.45);
    margin: 0 0 14px;
}

/* ── Étape 6 · Contact ── */
.sf-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.sf-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.10);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: clamp(12px, 3vw, 16px) clamp(14px, 3vw, 20px);
    font-size: clamp(0.875rem, 3vw, 1rem);
    color: #fff;
    outline: none;
    box-sizing: border-box;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
    font-weight: 500;
}

.sf-input:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
}

.sf-input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--sf-orange);
    box-shadow: 0 0 0 4px rgba(246, 104, 54, 0.20);
}

.sf-input::placeholder {
    color: rgba(255, 255, 255, 0.50);
}

.sf-input.sf-error {
    border-color: #f87171;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.12);
    animation: sfShake 0.35s ease;
}

@keyframes sfShake {
    0%, 100% { transform: translateX(0); }
    25%       { transform: translateX(-5px); }
    75%       { transform: translateX(5px); }
}

.sf-input-block {
    display: block;
    margin-bottom: 10px;
}

.sf-legal {
    font-size: 0.66rem;
    color: rgba(255, 255, 255, 0.26);
    text-align: center;
    margin: 12px 0 4px;
    line-height: 1.65;
}

.sf-legal a {
    color: rgba(255, 255, 255, 0.46);
    text-decoration: underline;
}

/* ── Navigation ── */
.sf-nav {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    align-items: center;
}

.sf-btn-primary {
    flex: 1;
    background: var(--sf-orange);
    color: #fff;
    border: none;
    border-radius: 16px;
    padding: 18px 24px;
    font-size: clamp(0.875rem, 3vw, 0.95rem);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
    text-align: center;
    width: 100%;
    letter-spacing: 0.01em;
}

.sf-btn-primary:hover:not(:disabled) {
    background: var(--sf-orange-hover);
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(246, 104, 54, 0.35);
}

.sf-btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: none;
}

.sf-btn-primary:disabled {
    opacity: 0.32;
    cursor: not-allowed;
}

#sf-step1-next {
    width: 100%;
    display: block;
}

.sf-btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.60);
    border-radius: 16px;
    padding: 18px 22px;
    font-size: clamp(0.825rem, 3vw, 0.88rem);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-family: inherit;
    white-space: nowrap;
    flex: 0 0 auto;
    min-width: 120px;
}

.sf-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.85);
}

/* ── Navigation pleine largeur sur mobile ── */
@media (max-width: 480px) {
    .sf-nav {
        flex-direction: column-reverse;
    }
    .sf-btn-primary,
    .sf-btn-secondary {
        width: 100%;
        flex: none;
        min-width: unset;
        text-align: center;
    }
}

/* ── Pied de widget ── */
.sf-powered {
    text-align: center;
    font-size: 0.62rem;
    color: rgba(255, 255, 255, 0.18);
    margin-top: 16px;
    letter-spacing: 0.02em;
}

.sf-powered strong {
    color: rgba(255, 255, 255, 0.34);
    font-weight: 600;
}

/* ── Succès ── */
.sf-success {
    text-align: center;
    padding: 30px 16px 20px;
}

.sf-success-icon {
    width: 62px;
    height: 62px;
    background: var(--sf-orange);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin: 0 auto 18px;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 8px 24px var(--sf-orange-glow);
    animation: sfPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

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

/* ── Spinner ── */
.sf-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(246, 104, 54, 0.20);
    border-top-color: var(--sf-orange);
    border-radius: 50%;
    animation: sfSpin 0.7s linear infinite;
    display: inline-block;
}

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

/* ── Mobile ── */
@media (max-width: 480px) {
    .sf-widget {
        padding: 22px 18px 18px;
        border-radius: 16px;
    }

    .sf-choice-card {
        padding: 16px 10px;
        min-height: 100px;
    }

    .sf-compass-btn,
    .sf-compass-center {
        width: 38px;
        height: 38px;
    }

    .sf-compass-btn {
        font-size: 0.62rem;
    }

    .sf-compass-grid {
        gap: 6px;
    }
}
