/* ==========================================================================
   CSS de la Calculadora de Envíos - Flexi Express
   Estilo Premium / Glassmorphism / Colores de Marca
   ========================================================================== */

:root {
    --primary-color: #009fe3;       /* Azul Flexi Express */
    --primary-hover: #0087c2;
    --text-main: #2b2b2b;          /* Gris Oscuro Flexi Express */
    --text-muted: #666666;
    --text-light: #ffffff;
    
    --bg-app: #f4f7fa;
    --card-bg: rgba(255, 255, 255, 0.85);
    --card-border: rgba(255, 255, 255, 0.6);
    --input-bg: #ffffff;
    --input-border: #dcdcdc;
    --input-focus: rgba(0, 159, 227, 0.2);
    
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.03);
    
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-app);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Background Abstract Decor */
.background-decor {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
}

.circle-1 {
    width: 500px;
    height: 500px;
    background-color: var(--primary-color);
    top: -10%;
    right: -10%;
}

.circle-2 {
    width: 600px;
    height: 600px;
    background-color: #00c6ff;
    bottom: -15%;
    left: -10%;
}

/* App Wrapper */
.app-container {
    width: 100%;
    max-width: 1200px;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Header */
.app-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem 2rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.logo-container {
    flex-shrink: 0;
}

.brand-logo {
    height: 55px;
    width: auto;
    object-fit: contain;
}

.header-info {
    flex-grow: 1;
}

.header-info h1 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.2rem;
}

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

/* Grid Layout */
.calculator-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 900px) {
    .calculator-grid {
        grid-template-columns: 1.1fr 0.9fr;
    }
}

/* Card Styling (Glassmorphism) */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(16px);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 2px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 1rem;
}

.icon-indicator {
    font-size: 1.5rem;
}

.card-header h2 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Form Styles */
.form-row {
    display: grid;
    gap: 1rem;
}

.split-2 {
    grid-template-columns: 1fr 1fr;
}

.split-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

@media (max-width: 480px) {
    .split-2, .split-3 {
        grid-template-columns: 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input[type="number"],
.custom-select {
    width: 100%;
    padding: 0.8rem 1rem;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-main);
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="number"]:focus,
.custom-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--input-focus);
}

/* Custom selects styling */
.custom-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23666666'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z' clip-rule='evenodd' /%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.25rem;
    padding-right: 2.5rem;
}

/* Input Prefixes & Suffixes */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-prefix {
    position: absolute;
    left: 1rem;
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 500;
}

.input-suffix {
    position: absolute;
    right: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.prefix-usd input {
    padding-left: 2rem;
}

.suffix-clp input {
    padding-right: 3rem;
}

/* Form Sections */
.form-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    border-top: 1px dashed rgba(0, 0, 0, 0.08);
    padding-top: 1rem;
}

.form-section-title h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
}

.badge {
    background-color: rgba(0, 159, 227, 0.1);
    color: var(--primary-color);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

/* Intermediate Results Card Display */
.intermediate-results {
    background: rgba(0, 159, 227, 0.03);
    border: 1px solid rgba(0, 159, 227, 0.08);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.result-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.result-row.highlight {
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.95rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding-top: 0.4rem;
    margin-top: 0.2rem;
}

.result-value {
    font-weight: 600;
    color: var(--text-main);
}

.result-row.highlight .result-value {
    color: var(--primary-color);
}

/* Exchange Rate Field Styles */
.exchange-rate-group {
    border-top: 1px dashed rgba(0, 0, 0, 0.08);
    padding-top: 1rem;
    margin-top: 0.5rem;
}

.rate-status {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Charges Breakdown (Right Column) */
.charges-breakdown {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.charge-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.charge-info {
    display: flex;
    flex-direction: column;
}

.charge-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
}

.charge-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.charge-value {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text-main);
}

/* Total Section */
.total-section {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(0, 159, 227, 0.06) 0%, rgba(0, 198, 255, 0.06) 100%);
    border: 1px solid rgba(0, 159, 227, 0.15);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.total-usd {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    border-bottom: 1px dashed rgba(0, 159, 227, 0.2);
    padding-bottom: 0.5rem;
}

.total-usd .total-val {
    font-weight: 600;
    color: var(--text-main);
}

.total-clp {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    align-items: center;
    text-align: center;
}

.total-clp .total-label {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--primary-color);
    letter-spacing: 0.5px;
}

.total-price-wrapper {
    display: flex;
    align-items: baseline;
    justify-content: center;
    color: var(--text-main);
    margin: 0.2rem 0;
}

.clp-symbol {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-right: 0.2rem;
}

.clp-value {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1;
}

.clp-currency {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-muted);
    margin-left: 0.3rem;
}

.exchange-info-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

/* Footer styling */
.app-footer {
    text-align: center;
    padding: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    margin-top: 1rem;
}

/* Hover and active animations */
.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 35px -5px rgba(0, 0, 0, 0.07), 0 12px 15px -5px rgba(0, 0, 0, 0.03);
}

/* Numeric inputs transitions */
input[type="number"] {
    transition: all 0.3s ease;
}

/* Animations for values changing */
@keyframes highlight-change {
    0% {
        color: var(--primary-color);
        transform: scale(1.05);
    }
    100% {
        color: var(--text-main);
        transform: scale(1);
    }
}

.value-changed {
    animation: highlight-change 0.4s ease-out;
}

/* ==========================================================================
   Estilos Adicionales: Campos Solo Lectura y Leads
   ========================================================================== */

/* Estilos de Solo Lectura */
.readonly-wrapper input[readonly] {
    background-color: #f1f3f4;
    color: var(--text-muted);
    cursor: not-allowed;
    border-color: #e2e8f0;
}

.readonly-wrapper input[readonly]:focus {
    box-shadow: none;
    border-color: #e2e8f0;
}

/* Contenedor de Captación de Leads */
.lead-capture-container {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
}

/* Contenedor de Captación de Leads (Puente a WhatsApp) */
.lead-capture-container {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
}

.lead-form-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.lead-form-intro-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    text-align: center;
    line-height: 1.5;
    margin-bottom: 0.2rem;
}

#lead-intro-total {
    color: var(--primary-color);
    font-weight: 800;
    font-size: 1.1rem;
    border-bottom: 1.5px solid rgba(0, 159, 227, 0.3);
    padding-bottom: 1px;
}

/* Formulario de Leads */
.lead-form {
    background: rgba(0, 159, 227, 0.02);
    border: 1px solid rgba(0, 159, 227, 0.12);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.01);
}

.form-group-lead input {
    width: 100%;
    padding: 0.75rem 0.9rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-main);
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group-lead input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--input-focus);
}

/* Botón principal de acceso a WhatsApp */
.lead-submit-btn {
    background-color: var(--primary-color);
    color: var(--text-light);
    border: none;
    padding: 0.9rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    box-shadow: 0 4px 10px rgba(0, 159, 227, 0.2);
}

.lead-submit-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(0, 159, 227, 0.3);
}

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

.lead-submit-btn:disabled {
    background-color: #cbd5e1;
    color: #64748b;
    border-color: #cbd5e1;
    box-shadow: none;
    cursor: not-allowed;
}

/* Mensaje de respuesta */
.lead-response-msg {
    font-size: 0.8rem;
    text-align: center;
    min-height: 1.2rem;
    transition: color 0.2s ease;
    margin-top: 0.2rem;
}

.lead-response-msg.success {
    color: #00aa50;
    font-weight: 600;
}

.lead-response-msg.error {
    color: #e07a5f;
    font-weight: 600;
}

