/* ═══════════════════════════════════════════════════════════════════════
   SIMULADOR DE FINANCIAMENTO OPUS — Browser Demo
   Design premium dark com acentos dourados
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Custom Properties ──────────────────────────────────────────────── */
:root {
    --so-bg-primary: #0B1120;
    --so-bg-card: #111827;
    --so-bg-card-alt: #151E30;
    --so-bg-input: #0A0F1A;
    --so-bg-hover: #1A2540;
    --so-border: rgba(201, 169, 110, 0.12);
    --so-border-input: #252F42;
    --so-border-focus: #C9A96E;
    --so-gold: #C9A96E;
    --so-gold-light: #DBBD88;
    --so-gold-dark: #A88B52;
    --so-gold-glow: rgba(201, 169, 110, 0.2);
    --so-gold-subtle: rgba(201, 169, 110, 0.08);
    --so-text: #F0EDE6;
    --so-text-secondary: #8B95A8;
    --so-text-muted: #5A6577;
    --so-success: #34D399;
    --so-error: #EF4444;
    --so-error-bg: rgba(239, 68, 68, 0.08);
    --so-radius-sm: 8px;
    --so-radius-md: 12px;
    --so-radius-lg: 16px;
    --so-radius-xl: 20px;
    --so-radius-full: 9999px;
    --so-shadow: 0 4px 32px rgba(0, 0, 0, 0.4);
    --so-shadow-gold: 0 4px 24px rgba(201, 169, 110, 0.15);
    --so-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --so-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* ── Body reset (browser-demo) ──────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--so-font);
    background: var(--so-bg-primary);
    color: var(--so-text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Wrapper principal ──────────────────────────────────────────────── */
.so-wrapper {
    max-width: 740px;
    margin: 48px auto;
    padding: 0 16px;
    font-family: var(--so-font);
    color: var(--so-text);
    font-size: 15px;
    line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════════════════════
   PROGRESSO / STEPPER
   ═══════════════════════════════════════════════════════════════════════ */
.so-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 36px;
    padding: 0 20px;
}

.so-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.so-step-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    border: 2px solid var(--so-border-input);
    background: var(--so-bg-primary);
    color: var(--so-text-muted);
    transition: var(--so-transition);
}

.so-step-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--so-text-muted);
    transition: var(--so-transition);
    white-space: nowrap;
}

/* Step ativo */
.so-progress-step.so-step-active .so-step-circle {
    border-color: var(--so-gold);
    background: linear-gradient(135deg, var(--so-gold), var(--so-gold-dark));
    color: #0B1120;
    box-shadow: 0 0 20px var(--so-gold-glow);
}

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

/* Step completo */
.so-progress-step.so-step-completed .so-step-circle {
    border-color: var(--so-success);
    background: var(--so-success);
    color: #0B1120;
}

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

/* Linha de progresso */
.so-progress-line {
    flex: 1;
    max-width: 160px;
    height: 2px;
    background: var(--so-border-input);
    position: relative;
    margin: 0 16px;
    margin-bottom: 28px;
    border-radius: 2px;
    overflow: hidden;
}

.so-progress-line-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--so-gold), var(--so-gold-light));
    border-radius: 2px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ═══════════════════════════════════════════════════════════════════════
   STEPS (visibilidade e animação)
   ═══════════════════════════════════════════════════════════════════════ */
.so-step {
    display: none;
    animation: soFadeSlideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.so-step.so-step-visible {
    display: block;
}

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

/* ═══════════════════════════════════════════════════════════════════════
   CARD
   ═══════════════════════════════════════════════════════════════════════ */
.so-card {
    background: var(--so-bg-card);
    border: 1px solid var(--so-border);
    border-radius: var(--so-radius-xl);
    padding: 40px;
    box-shadow: var(--so-shadow);
    position: relative;
    overflow: hidden;
}

/* Brilho dourado sutil no topo */
.so-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--so-gold-glow) 30%,
        var(--so-gold) 50%,
        var(--so-gold-glow) 70%,
        transparent 100%
    );
    opacity: 0.6;
}

.so-card-header {
    margin-bottom: 32px;
    text-align: center;
}

.so-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--so-text);
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

.so-subtitle {
    font-size: 14px;
    color: var(--so-text-secondary);
    line-height: 1.6;
    max-width: 420px;
    margin: 0 auto;
}

/* ═══════════════════════════════════════════════════════════════════════
   FORMULÁRIO
   ═══════════════════════════════════════════════════════════════════════ */
.so-field {
    margin-bottom: 20px;
    position: relative;
}

.so-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--so-text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.so-input,
.so-wrapper select {
    width: 100%;
    height: 50px;
    padding: 0 16px;
    background: var(--so-bg-input);
    border: 1.5px solid var(--so-border-input);
    border-radius: var(--so-radius-md);
    color: var(--so-text);
    font-family: var(--so-font);
    font-size: 15px;
    outline: none;
    transition: var(--so-transition);
    -webkit-appearance: none;
    appearance: none;
}

.so-input::placeholder {
    color: var(--so-text-muted);
}

.so-input:hover,
.so-wrapper select:hover {
    border-color: rgba(201, 169, 110, 0.3);
}

.so-input:focus,
.so-wrapper select:focus {
    border-color: var(--so-gold);
    box-shadow: 0 0 0 3px var(--so-gold-subtle);
}

/* Select wrapper */
.so-select-wrap {
    position: relative;
}

.so-select-arrow {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid var(--so-text-secondary);
    pointer-events: none;
    transition: var(--so-transition);
}

.so-select-wrap:hover .so-select-arrow {
    border-top-color: var(--so-gold);
}

/* Row (campos lado a lado) */
.so-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Erro */
.so-error {
    display: none;
    font-size: 12px;
    color: var(--so-error);
    margin-top: 6px;
    font-weight: 500;
    padding-left: 2px;
}

.so-error.so-error-visible {
    display: block;
    animation: soShake 0.4s ease;
}

.so-field.so-has-error .so-input,
.so-field.so-has-error select {
    border-color: var(--so-error);
    box-shadow: 0 0 0 3px var(--so-error-bg);
}

@keyframes soShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}

/* ═══════════════════════════════════════════════════════════════════════
   BOTÕES
   ═══════════════════════════════════════════════════════════════════════ */
.so-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 32px;
    border: none;
    border-radius: var(--so-radius-md);
    font-family: var(--so-font);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--so-transition);
    text-decoration: none;
    outline: none;
    position: relative;
    overflow: hidden;
}

.so-btn-primary {
    background: linear-gradient(135deg, var(--so-gold), var(--so-gold-dark));
    color: #0B1120;
    width: 100%;
    height: 54px;
    font-size: 16px;
    letter-spacing: 0.3px;
}

.so-btn-primary:hover {
    background: linear-gradient(135deg, var(--so-gold-light), var(--so-gold));
    box-shadow: var(--so-shadow-gold);
    transform: translateY(-1px);
}

.so-btn-primary:active {
    transform: translateY(0);
}

/* Efeito shimmer */
.so-btn-primary::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 40%;
    height: 200%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.15),
        transparent
    );
    transform: skewX(-15deg);
    transition: none;
    animation: soShimmer 3s ease-in-out infinite;
}

@keyframes soShimmer {
    0% { left: -60%; }
    30% { left: 120%; }
    100% { left: 120%; }
}

.so-btn-secondary {
    background: transparent;
    color: var(--so-text-secondary);
    border: 1.5px solid var(--so-border-input);
    padding: 14px 24px;
    height: 54px;
}

.so-btn-secondary:hover {
    border-color: var(--so-gold);
    color: var(--so-gold);
    background: var(--so-gold-subtle);
}

.so-btn-group {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.so-btn-group .so-btn-primary {
    flex: 1;
}

/* ═══════════════════════════════════════════════════════════════════════
   BARRA DE INFORMAÇÕES (Etapa 2)
   ═══════════════════════════════════════════════════════════════════════ */
.so-info-bar {
    display: flex;
    gap: 1px;
    background: var(--so-border-input);
    border-radius: var(--so-radius-md);
    overflow: hidden;
    margin-bottom: 28px;
}

.so-info-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    background: var(--so-bg-card-alt);
    gap: 4px;
}

.so-info-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--so-text-muted);
    font-weight: 600;
}

.so-info-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--so-text);
    text-align: center;
}

.so-info-valor {
    color: var(--so-gold);
    font-size: 15px;
    font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════════════════
   AVISO (sem prazos)
   ═══════════════════════════════════════════════════════════════════════ */
.so-aviso {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    background: var(--so-error-bg);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--so-radius-md);
    margin-bottom: 20px;
    color: #FCA5A5;
    font-size: 13px;
    line-height: 1.6;
}

.so-aviso svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--so-error);
}

/* ═══════════════════════════════════════════════════════════════════════
   RESULTADO DA SIMULAÇÃO
   ═══════════════════════════════════════════════════════════════════════ */
#so-resultado {
    margin-top: 24px;
    animation: soFadeSlideIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Header */
.so-res-header {
    background: linear-gradient(135deg, #111827 0%, #1A2540 100%);
    border: 1px solid var(--so-border);
    border-radius: var(--so-radius-xl);
    padding: 32px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
}

.so-res-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--so-gold), transparent);
    opacity: 0.5;
}

.so-res-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--so-gold-subtle);
    border: 1px solid rgba(201, 169, 110, 0.2);
    border-radius: var(--so-radius-full);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--so-gold);
    margin-bottom: 16px;
}

.so-res-empreendimento {
    font-size: 22px;
    font-weight: 700;
    color: var(--so-text);
    margin-bottom: 4px;
}

.so-res-cliente {
    font-size: 14px;
    color: var(--so-text-secondary);
    margin-bottom: 16px;
}

.so-res-valor-imovel {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.so-res-valor-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--so-text-muted);
    font-weight: 600;
}

.so-res-valor-numero {
    font-size: 28px;
    font-weight: 800;
    color: var(--so-gold);
    letter-spacing: -0.5px;
}

/* Tags do plano */
.so-res-plano-info {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--so-border);
}

.so-res-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--so-radius-full);
    font-size: 12px;
    color: var(--so-text-secondary);
    font-weight: 500;
}

.so-res-tag strong {
    color: var(--so-text);
    font-weight: 600;
}

/* Grid de parcelas */
.so-res-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.so-res-card {
    background: var(--so-bg-card);
    border: 1px solid var(--so-border);
    border-radius: var(--so-radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--so-transition);
    animation: soCardFadeIn 0.5s ease forwards;
    opacity: 0;
    position: relative;
}

.so-res-card:nth-child(1) { animation-delay: 0.1s; }
.so-res-card:nth-child(2) { animation-delay: 0.2s; }
.so-res-card:nth-child(3) { animation-delay: 0.3s; }
.so-res-card:nth-child(4) { animation-delay: 0.4s; }

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

.so-res-card:hover {
    border-color: rgba(201, 169, 110, 0.25);
    transform: translateX(4px);
}

/* Barra lateral ao hover */
.so-res-card::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: transparent;
    border-radius: 3px 0 0 3px;
    transition: var(--so-transition);
}

.so-res-card:hover::after {
    background: var(--so-gold);
}

/* Ícone */
.so-res-icon {
    width: 52px;
    height: 52px;
    border-radius: var(--so-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.so-res-icon-sinal {
    background: linear-gradient(135deg, rgba(201, 169, 110, 0.15), rgba(201, 169, 110, 0.05));
    border: 1px solid rgba(201, 169, 110, 0.2);
    animation: soPulseGold 2s ease-in-out infinite;
}

.so-res-icon-mensal {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.05));
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.so-res-icon-semestral {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(168, 85, 247, 0.05));
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.so-res-icon-anual {
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.15), rgba(52, 211, 153, 0.05));
    border: 1px solid rgba(52, 211, 153, 0.2);
}

@keyframes soPulseGold {
    0%, 100% { box-shadow: 0 0 0 0 rgba(201, 169, 110, 0); }
    50% { box-shadow: 0 0 12px 4px rgba(201, 169, 110, 0.12); }
}

/* Card body */
.so-res-card-body {
    flex: 1;
    min-width: 0;
}

.so-res-card-title {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--so-text-muted);
    margin-bottom: 4px;
}

.so-res-card-valor {
    font-size: 22px;
    font-weight: 700;
    color: var(--so-text);
    letter-spacing: -0.3px;
}

.so-res-card-detalhe {
    font-size: 13px;
    color: var(--so-text-secondary);
    margin-top: 4px;
    line-height: 1.5;
}

/* Percentual badge */
.so-res-card-pct {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--so-radius-md);
    flex-shrink: 0;
}

.so-res-pct-numero {
    font-size: 20px;
    font-weight: 800;
    color: var(--so-gold);
}

.so-res-pct-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--so-text-muted);
    font-weight: 600;
}

/* IPCA nota */
.so-res-nota {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: rgba(251, 191, 36, 0.06);
    border: 1px solid rgba(251, 191, 36, 0.15);
    border-radius: var(--so-radius-md);
    font-size: 13px;
    color: #FCD34D;
    margin-bottom: 12px;
    line-height: 1.5;
}

/* Disclaimer */
.so-res-disclaimer {
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--so-radius-md);
    font-size: 12px;
    color: var(--so-text-muted);
    line-height: 1.7;
    text-align: center;
    margin-bottom: 16px;
}

/* Ações do resultado */
.so-res-actions {
    display: flex;
    gap: 12px;
}

.so-res-actions .so-btn {
    flex: 1;
}

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVO
   ═══════════════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
    .so-wrapper {
        margin: 24px auto;
        padding: 0 12px;
        font-size: 14px;
    }

    .so-card {
        padding: 28px 20px;
        border-radius: var(--so-radius-lg);
    }

    .so-title {
        font-size: 22px;
    }

    .so-subtitle {
        font-size: 13px;
    }

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

    .so-btn-group {
        flex-direction: column-reverse;
    }

    .so-btn-secondary {
        width: 100%;
        justify-content: center;
    }

    .so-info-bar {
        flex-direction: column;
    }

    .so-progress {
        padding: 0 10px;
        margin-bottom: 24px;
    }

    .so-step-circle {
        width: 38px;
        height: 38px;
        font-size: 14px;
    }

    .so-step-label {
        font-size: 10px;
    }

    .so-progress-line {
        max-width: 80px;
        margin: 0 10px;
        margin-bottom: 24px;
    }

    /* Resultado */
    .so-res-header {
        padding: 24px 20px;
    }

    .so-res-empreendimento {
        font-size: 18px;
    }

    .so-res-valor-numero {
        font-size: 22px;
    }

    .so-res-card {
        padding: 20px 16px;
        gap: 14px;
    }

    .so-res-icon {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    .so-res-card-valor {
        font-size: 18px;
    }

    .so-res-card-pct {
        padding: 8px 12px;
    }

    .so-res-pct-numero {
        font-size: 16px;
    }

    .so-res-plano-info {
        gap: 6px;
    }

    .so-res-tag {
        font-size: 11px;
        padding: 4px 10px;
    }

    .so-res-actions {
        flex-direction: column;
    }
}

@media (max-width: 380px) {
    .so-card {
        padding: 24px 16px;
    }

    .so-res-card {
        flex-wrap: wrap;
    }

    .so-res-card-pct {
        width: 100%;
        flex-direction: row;
        gap: 8px;
        justify-content: center;
    }
}

/* ── Input date fix ─────────────────────────────────────────────────── */
.so-input[type="date"] {
    min-height: 50px;
}

.so-input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.7);
    cursor: pointer;
}
