/* ============================================
   Easy Haus - Presupuesto Casas
   Premium WordPress Plugin Styles
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&display=swap');

/* ─── CSS Variables / Design Tokens ─── */
:root {
    --eh-primary: #0f172a;
    --eh-primary-light: #1e293b;
    --eh-accent: #f59e0b;
    --eh-accent-hover: #d97706;
    --eh-accent-glow: rgba(245, 158, 11, 0.25);
    --eh-surface: #ffffff;
    --eh-surface-alt: #f8fafc;
    --eh-surface-glass: rgba(255, 255, 255, 0.7);
    --eh-border: #e2e8f0;
    --eh-border-focus: #f59e0b;
    --eh-text: #0f172a;
    --eh-text-secondary: #64748b;
    --eh-text-muted: #94a3b8;
    --eh-success: #10b981;
    --eh-success-bg: #ecfdf5;
    --eh-error: #ef4444;
    --eh-error-bg: #fef2f2;
    --eh-gradient-hero: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
    --eh-gradient-gold: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --eh-gradient-section: linear-gradient(135deg, rgba(245, 158, 11, 0.05) 0%, rgba(15, 23, 42, 0.03) 100%);
    --eh-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --eh-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --eh-shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
    --eh-shadow-glow: 0 0 30px rgba(245, 158, 11, 0.15);
    --eh-radius-sm: 8px;
    --eh-radius-md: 12px;
    --eh-radius-lg: 16px;
    --eh-radius-xl: 24px;
    --eh-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --eh-font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --eh-font-display: 'Outfit', var(--eh-font-primary);
}

/* ─── Reset & Base ─── */
.eh-wrapper {
    font-family: var(--eh-font-primary);
    color: var(--eh-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
}

.eh-wrapper *, .eh-wrapper *::before, .eh-wrapper *::after {
    box-sizing: border-box;
}

/* ─── Hero Header ─── */
.eh-hero {
    background: var(--eh-gradient-hero);
    padding: 48px 40px;
    border-radius: var(--eh-radius-xl);
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.eh-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.15) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.eh-hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.eh-hero-logo {
    font-family: var(--eh-font-display);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--eh-accent);
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.eh-hero h1 {
    font-family: var(--eh-font-display);
    font-size: clamp(28px, 4vw, 42px);
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 12px;
    line-height: 1.15;
    position: relative;
    z-index: 1;
}

.eh-hero p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    position: relative;
    z-index: 1;
    max-width: 520px;
    margin: 0 auto;
}

/* ─── Progress Indicator ─── */
.eh-progress-bar {
    background: var(--eh-surface);
    border: 1px solid var(--eh-border);
    border-radius: var(--eh-radius-lg);
    padding: 20px 28px;
    margin-bottom: 28px;
    box-shadow: var(--eh-shadow-sm);
    position: sticky;
    top: 20px;
    z-index: 100;
    backdrop-filter: blur(12px);
    background: var(--eh-surface-glass);
}

.eh-progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.eh-progress-step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--eh-text-muted);
    white-space: nowrap;
    cursor: pointer;
    transition: var(--eh-transition);
    padding: 6px 10px;
    border-radius: var(--eh-radius-sm);
}

.eh-progress-step:hover {
    color: var(--eh-text-secondary);
    background: var(--eh-surface-alt);
}

.eh-progress-step.active {
    color: var(--eh-accent);
    font-weight: 600;
}

.eh-progress-step .step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--eh-border);
    color: var(--eh-text-muted);
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    transition: var(--eh-transition);
}

.eh-progress-step.active .step-num {
    background: var(--eh-gradient-gold);
    color: white;
    box-shadow: 0 2px 8px var(--eh-accent-glow);
}

.eh-progress-step.completed .step-num {
    background: var(--eh-success);
    color: white;
}

.eh-progress-step.completed .step-num::after {
    content: '✓';
    font-size: 12px;
}

.eh-progress-track {
    height: 4px;
    background: var(--eh-border);
    border-radius: 2px;
    margin-top: 12px;
    overflow: hidden;
}

.eh-progress-fill {
    height: 100%;
    background: var(--eh-gradient-gold);
    border-radius: 2px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px var(--eh-accent-glow);
}

/* ─── Form Sections ─── */
.eh-section {
    background: var(--eh-surface);
    border: 1px solid var(--eh-border);
    border-radius: var(--eh-radius-lg);
    margin-bottom: 24px;
    overflow: hidden;
    box-shadow: var(--eh-shadow-sm);
    transition: var(--eh-transition);
    animation: eh-fadeInUp 0.5s ease-out both;
}

.eh-section:hover {
    box-shadow: var(--eh-shadow-md);
}

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

.eh-section-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 28px;
    cursor: pointer;
    user-select: none;
    transition: var(--eh-transition);
    background: var(--eh-gradient-section);
    border-bottom: 1px solid transparent;
}

.eh-section-header:hover {
    background: rgba(245, 158, 11, 0.06);
}

.eh-section.open .eh-section-header {
    border-bottom-color: var(--eh-border);
}

.eh-section-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--eh-radius-sm);
    background: var(--eh-gradient-gold);
    color: white;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px var(--eh-accent-glow);
}

.eh-section-title {
    flex: 1;
}

.eh-section-title h2 {
    font-family: var(--eh-font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--eh-text);
    margin: 0;
    line-height: 1.3;
}

.eh-section-title p {
    font-size: 13px;
    color: var(--eh-text-secondary);
    margin: 2px 0 0;
}

.eh-section-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--eh-surface-alt);
    border: 1px solid var(--eh-border);
    transition: var(--eh-transition);
    flex-shrink: 0;
}

.eh-section-toggle svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
    color: var(--eh-text-secondary);
}

.eh-section.open .eh-section-toggle svg {
    transform: rotate(180deg);
}

.eh-section-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.eh-section.open .eh-section-body {
    max-height: 5000px;
}

.eh-section-content {
    padding: 28px;
}

/* ─── Subsection ─── */
.eh-subsection {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px dashed var(--eh-border);
}

.eh-subsection:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.eh-subsection-title {
    font-family: var(--eh-font-display);
    font-size: 15px;
    font-weight: 600;
    color: var(--eh-primary);
    margin: 0 0 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.eh-subsection-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background: var(--eh-gradient-gold);
    border-radius: 2px;
}

.eh-subsection-desc {
    font-size: 13px;
    color: var(--eh-text-secondary);
    margin: 0 0 16px;
    line-height: 1.5;
    padding-left: 12px;
}

/* ─── Form Grid ─── */
.eh-field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.eh-field-grid.compact {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.eh-field-grid.single-col {
    grid-template-columns: 1fr;
}

/* ─── Form Fields ─── */
.eh-field {
    position: relative;
}

.eh-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--eh-text);
    margin-bottom: 6px;
    letter-spacing: 0.01em;
}

.eh-field label .eh-unit {
    font-weight: 400;
    color: var(--eh-text-muted);
    font-size: 12px;
}

.eh-field input[type="text"],
.eh-field input[type="email"],
.eh-field input[type="tel"],
.eh-field input[type="number"],
.eh-field input[type="date"],
.eh-field select,
.eh-field textarea {
    width: 100%;
    padding: 11px 14px;
    font-family: var(--eh-font-primary);
    font-size: 14px;
    color: var(--eh-text);
    background: var(--eh-surface-alt);
    border: 1.5px solid var(--eh-border);
    border-radius: var(--eh-radius-sm);
    transition: var(--eh-transition);
    outline: none;
    -moz-appearance: textfield;
}

.eh-field input[type="number"]::-webkit-inner-spin-button,
.eh-field input[type="number"]::-webkit-outer-spin-button {
    opacity: 1;
}

.eh-field input:focus,
.eh-field select:focus,
.eh-field textarea:focus {
    border-color: var(--eh-border-focus);
    box-shadow: 0 0 0 3px var(--eh-accent-glow);
    background: var(--eh-surface);
}

.eh-field input::placeholder {
    color: var(--eh-text-muted);
    font-weight: 400;
}

.eh-field textarea {
    min-height: 100px;
    resize: vertical;
}

.eh-field select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* ─── Distribution Table ─── */
.eh-dist-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}

.eh-dist-table th {
    font-size: 12px;
    font-weight: 600;
    color: var(--eh-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 10px 8px;
    text-align: center;
    background: var(--eh-surface-alt);
    border: 1px solid var(--eh-border);
}

.eh-dist-table th:first-child {
    text-align: left;
}

.eh-dist-table td {
    padding: 6px 8px;
    border: 1px solid var(--eh-border);
    vertical-align: middle;
}

.eh-dist-table td:first-child {
    font-size: 13px;
    font-weight: 500;
    color: var(--eh-text);
    background: var(--eh-surface-alt);
    white-space: nowrap;
}

.eh-dist-table input[type="number"] {
    width: 100%;
    padding: 8px 10px;
    font-size: 14px;
    text-align: center;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    transition: var(--eh-transition);
    font-family: var(--eh-font-primary);
    color: var(--eh-text);
}

.eh-dist-table input[type="number"]:focus {
    border-color: var(--eh-border-focus);
    background: var(--eh-surface);
    box-shadow: 0 0 0 2px var(--eh-accent-glow);
}

/* ─── Info Callout ─── */
.eh-info-callout {
    display: flex;
    gap: 12px;
    padding: 14px 18px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.06) 0%, rgba(245, 158, 11, 0.02) 100%);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: var(--eh-radius-sm);
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--eh-text-secondary);
    line-height: 1.5;
}

.eh-info-callout .callout-icon {
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 1px;
}

.eh-info-callout.success {
    background: var(--eh-success-bg);
    border-color: rgba(16, 185, 129, 0.3);
}

.eh-info-callout.error {
    background: var(--eh-error-bg);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--eh-error);
}

/* ─── Price Row ─── */
.eh-price-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--eh-surface-alt);
    border-radius: var(--eh-radius-sm);
    margin-bottom: 8px;
    border: 1px solid var(--eh-border);
    transition: var(--eh-transition);
}

.eh-price-row:hover {
    border-color: rgba(245, 158, 11, 0.3);
}

.eh-price-row .price-label {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: var(--eh-text);
}

.eh-price-row .price-unit {
    font-size: 12px;
    color: var(--eh-text-muted);
    font-weight: 500;
    min-width: 60px;
    text-align: center;
}

.eh-price-row .price-value {
    font-family: var(--eh-font-display);
    font-size: 14px;
    font-weight: 600;
    color: var(--eh-primary);
    min-width: 90px;
    text-align: right;
}

/* ─── Totals Card ─── */
.eh-totals-card {
    background: var(--eh-gradient-hero);
    border-radius: var(--eh-radius-md);
    padding: 24px;
    margin-top: 20px;
}

.eh-totals-card .total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.eh-totals-card .total-row:last-child {
    border-bottom: none;
    padding-top: 12px;
    margin-top: 4px;
}

.eh-totals-card .total-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.eh-totals-card .total-value {
    font-family: var(--eh-font-display);
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
}

.eh-totals-card .total-row.grand .total-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--eh-accent);
}

.eh-totals-card .total-row.grand .total-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--eh-accent);
}

/* ─── Included Features ─── */
.eh-included-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
}

.eh-included-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    color: var(--eh-text);
    padding: 10px 14px;
    background: var(--eh-surface-alt);
    border-radius: var(--eh-radius-sm);
    border: 1px solid var(--eh-border);
}

.eh-included-list li::before {
    content: '✓';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--eh-success);
    color: white;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ─── Piscina Radio Cards ─── */
.eh-radio-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.eh-radio-card {
    position: relative;
}

.eh-radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.eh-radio-card label {
    display: block;
    padding: 14px 18px;
    border: 2px solid var(--eh-border);
    border-radius: var(--eh-radius-sm);
    cursor: pointer;
    transition: var(--eh-transition);
    background: var(--eh-surface-alt);
}

.eh-radio-card label:hover {
    border-color: rgba(245, 158, 11, 0.4);
    background: var(--eh-surface);
}

.eh-radio-card input:checked + label {
    border-color: var(--eh-accent);
    background: rgba(245, 158, 11, 0.04);
    box-shadow: 0 0 0 3px var(--eh-accent-glow);
}

.eh-radio-card .card-size {
    font-size: 15px;
    font-weight: 600;
    color: var(--eh-text);
    margin-bottom: 4px;
}

.eh-radio-card .card-price {
    font-family: var(--eh-font-display);
    font-size: 14px;
    font-weight: 700;
    color: var(--eh-accent);
}

/* ─── Payment Timeline ─── */
.eh-timeline {
    position: relative;
    padding-left: 28px;
}

.eh-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--eh-border);
}

.eh-timeline-item {
    position: relative;
    padding: 12px 0;
}

.eh-timeline-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 18px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--eh-accent);
    border: 2px solid white;
    box-shadow: 0 0 0 2px var(--eh-accent);
}

.eh-timeline-item .timeline-pct {
    font-family: var(--eh-font-display);
    font-size: 15px;
    font-weight: 700;
    color: var(--eh-primary);
}

.eh-timeline-item .timeline-desc {
    font-size: 13px;
    color: var(--eh-text-secondary);
    margin-top: 2px;
}

/* ─── Submit Button ─── */
.eh-submit-section {
    text-align: center;
    padding: 40px 0 20px;
}

.eh-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 48px;
    font-family: var(--eh-font-display);
    font-size: 17px;
    font-weight: 700;
    color: white;
    background: var(--eh-gradient-gold);
    border: none;
    border-radius: 60px;
    cursor: pointer;
    transition: var(--eh-transition);
    box-shadow: 0 4px 20px var(--eh-accent-glow);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.02em;
}

.eh-submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.6s ease;
}

.eh-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(245, 158, 11, 0.35);
}

.eh-submit-btn:hover::before {
    left: 100%;
}

.eh-submit-btn:active {
    transform: translateY(0);
}

.eh-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.eh-submit-btn .btn-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: eh-spin 0.7s linear infinite;
}

.eh-submit-btn.loading .btn-spinner {
    display: block;
}

.eh-submit-btn.loading .btn-text {
    opacity: 0.7;
}

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

/* ─── Result Messages ─── */
.eh-result-message {
    padding: 20px 24px;
    border-radius: var(--eh-radius-md);
    margin-top: 20px;
    display: none;
    animation: eh-fadeInUp 0.4s ease-out;
    font-size: 15px;
    font-weight: 500;
    text-align: center;
}

.eh-result-message.success {
    display: block;
    background: var(--eh-success-bg);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #065f46;
}

.eh-result-message.error {
    display: block;
    background: var(--eh-error-bg);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--eh-error);
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .eh-hero {
        padding: 32px 24px;
    }

    .eh-progress-steps {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .eh-progress-step span:not(.step-num) {
        display: none;
    }

    .eh-section-content {
        padding: 20px;
    }

    .eh-field-grid {
        grid-template-columns: 1fr;
    }

    .eh-radio-cards {
        grid-template-columns: 1fr;
    }

    .eh-included-list {
        grid-template-columns: 1fr;
    }

    .eh-dist-table {
        font-size: 12px;
    }

    .eh-submit-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .eh-wrapper {
        padding: 0 8px;
    }

    .eh-hero {
        padding: 24px 16px;
        border-radius: var(--eh-radius-md);
    }

    .eh-progress-bar {
        padding: 14px 16px;
    }

    .eh-section-header {
        padding: 16px 18px;
    }
}
