:root {
    --primary-color: #FF6B35;
    --primary-dark: #FF4500;
    --bg-outer: #0a0a0f;
    --bg-inner: #121218;
    --bg-panel: #1a1a24;
    --bg-accent: rgba(255, 255, 255, 0.04);
    --border-soft: rgba(255, 255, 255, 0.08);
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --shadow-xl: 0 40px 90px -40px rgba(0, 0, 0, 0.85);
    --radius-lg: 28px;
    --radius-md: 18px;
    --radius-sm: 12px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html, body {
    height: 100%;
}

body {
    font-family: var(--font-family);
    background: linear-gradient(150deg, var(--bg-outer) 0%, #11111a 55%, #161622 100%);
    color: var(--text-primary);
    padding: 40px 24px;
}

.calculator-page {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
}

.calculator-shell {
    background: var(--bg-inner);
    border-radius: var(--radius-lg);
    padding: 48px;
    box-shadow: var(--shadow-xl);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 36px;
    position: relative;
}

.calculator-shell::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: radial-gradient(circle at 15% -20%, rgba(255, 107, 53, 0.25), transparent 55%),
                radial-gradient(circle at 85% 0%, rgba(255, 107, 53, 0.18), transparent 55%);
    pointer-events: none;
    z-index: 0;
}

.calculator-header {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
}

.brand-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 220px;
    height: auto;
    filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.5));
}

.brand-chat {
    position: relative;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 12px;
    box-shadow: 0 16px 30px -18px rgba(255, 107, 53, 0.8);
    letter-spacing: 0.4px;
    animation: chatFloat 3s ease-in-out infinite;
}

.brand-chat::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 14px;
    width: 10px;
    height: 10px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    transform: rotate(45deg);
    border-radius: 2px;
}

.calculator-header h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.2px;
}

.calculator-body {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: 32px;
}

.panel {
    background: var(--bg-panel);
    border-radius: var(--radius-md);
    padding: 32px;
    border: 1px solid var(--border-soft);
    box-shadow: 0 28px 60px -45px rgba(0, 0, 0, 0.6);
}

.panel-inputs {
    display: flex;
    flex-direction: column;
    gap: 22px;
    min-width: 0;
    overflow: hidden;
}

@media (max-width: 992px) {
    body {
        padding: 28px 16px 40px;
    }

    .calculator-shell {
        padding: 32px 24px;
        margin: 0 auto;
    }

    .calculator-body {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .calculator-shell {
        padding: 28px 22px;
        border-radius: 22px;
    }

    .brand-logo {
        width: 180px;
    }

    .brand-chat {
        font-size: 14px;
        padding: 5px 12px;
    }

    .panel {
        padding: 24px 20px;
    }

    .plan-highlight {
        flex-direction: column;
        gap: 16px;
    }

    .control-card__actions {
        grid-template-columns: 44px 1fr 44px;
    }

    .quantity-btn,
    .control-card input {
        height: 44px;
    }
}

.plan-highlight {
    display: flex;
    gap: 18px;
    padding: 26px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(14px);
    box-shadow: 0 22px 45px -30px rgba(255, 107, 53, 0.45);
}

.plan-highlight__icon {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    background: linear-gradient(140deg, var(--primary-color), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    flex-shrink: 0;
    box-shadow: 0 18px 34px -24px rgba(255, 107, 53, 0.75);
}

.plan-highlight h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
}

.plan-highlight__price {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 6px;
}

.plan-highlight__price span {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-muted);
    margin-left: 4px;
}

.plan-highlight__details {
    font-size: 14px;
    color: var(--text-secondary);
}

.control-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 24px;
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(10px);
    box-shadow: 0 18px 40px -32px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

.control-card__header {
    display: flex;
    gap: 16px;
    align-items: center;
}

.control-card__icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: rgba(255, 107, 53, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 18px;
}

.control-card h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.control-card p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.control-card__actions {
    display: grid;
    grid-template-columns: 48px 1fr 48px;
    gap: 12px;
    align-items: center;
}

.quantity-btn {
    height: 48px;
    border: none;
    border-radius: var(--radius-sm);
    background: linear-gradient(140deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    box-shadow: 0 16px 28px -20px rgba(255, 107, 53, 0.8);
}

.quantity-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 36px -24px rgba(255, 107, 53, 0.9);
}

.quantity-btn:active {
    transform: scale(0.94);
    box-shadow: 0 12px 20px -18px rgba(255, 107, 53, 0.9);
}

.control-card input {
    height: 48px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.25);
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.35);
}

.control-card input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.3);
}

.panel-summary {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.summary-header {
    display: flex;
    gap: 16px;
    align-items: center;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.summary-header__icon {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    background: rgba(255, 107, 53, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 20px;
}

.summary-header h3 {
    font-size: 20px;
    font-weight: 800;
}

.summary-header p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.summary-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.summary-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    color: var(--text-primary);
    font-size: 15px;
}

.summary-row strong {
    display: block;
    font-weight: 700;
}

.summary-row small {
    display: block;
    color: var(--text-muted);
    margin-top: 4px;
}

.summary-total {
    margin-top: 8px;
    padding: 26px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    text-align: center;
    box-shadow: 0 30px 50px -30px rgba(255, 107, 53, 0.4);
}

.summary-total__label {
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: center;
    justify-content: center;
}

.summary-total__icon {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
}

.summary-total__label strong {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.3px;
}

.summary-total__value {
    font-size: 32px;
    font-weight: 900;
    color: var(--primary-color);
    letter-spacing: 0.4px;
    transition: transform 0.25s ease-in-out;
}

.summary-total__value.is-updated {
    transform: scale(1.08);
}

/* ===== PROPOSAL CTA ===== */
.proposal-cta {
    margin-top: 36px;
    padding: 32px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.04), rgba(10, 10, 15, 0.35));
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    box-shadow: 0 24px 45px -32px rgba(0, 0, 0, 0.7);
}

.proposal-text h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
}

.proposal-text p {
    color: var(--text-secondary);
    font-size: 15px;
}

.btn-proposal {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 16px;
    border: none;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 20px 40px -24px rgba(255, 107, 53, 0.9);
}

.btn-proposal:hover {
    transform: translateY(-2px);
    box-shadow: 0 24px 40px -20px rgba(255, 107, 53, 0.9);
}

.btn-proposal:active {
    transform: scale(0.97);
}

.btn-proposal--full {
    width: 100%;
    justify-content: center;
    margin-top: 12px;
}

/* ===== PROPOSAL MODAL ===== */
.proposal-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1200;
}

.proposal-modal.is-active {
    display: flex;
}

.proposal-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 15, 0.78);
    backdrop-filter: blur(6px);
}

.proposal-modal__content {
    position: relative;
    width: min(480px, 92%);
    background: var(--bg-inner);
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 35px 60px -30px rgba(0, 0, 0, 0.85);
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 1;
}

.proposal-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.proposal-modal__header h2 {
    font-size: 22px;
    font-weight: 800;
}

.proposal-modal__close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.proposal-modal__close:hover {
    color: var(--text-primary);
}

.proposal-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-field label {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-secondary);
}

.form-field input {
    height: 48px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.25);
    color: var(--text-primary);
    padding: 0 16px;
    font-size: 15px;
    transition: var(--transition);
}

.form-field input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.25);
}

.proposal-feedback {
    font-size: 14px;
    margin-top: 4px;
    min-height: 20px;
}

.proposal-feedback.is-success {
    color: #34d399;
}

.proposal-feedback.is-error {
    color: #f87171;
}

@keyframes chatFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}

@media (max-width: 992px) {
    body {
        padding: 28px 16px 40px;
    }

    .calculator-shell {
        padding: 32px 24px;
        margin: 0 auto;
    }

    .calculator-body {
        grid-template-columns: 1fr;
    }

    .proposal-cta {
        flex-direction: column;
        align-items: flex-start;
    }

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

@media (max-width: 600px) {
    .calculator-shell {
        padding: 28px 22px;
        border-radius: 22px;
    }

    .brand-logo {
        width: 180px;
    }

    .brand-chat {
        font-size: 14px;
        padding: 5px 12px;
    }

    .panel {
        padding: 24px 20px;
    }

    .plan-highlight {
        flex-direction: column;
        gap: 16px;
    }

    .control-card__actions {
        grid-template-columns: 44px 1fr 44px;
    }

    .quantity-btn,
    .control-card input {
        height: 44px;
    }
}

/* ===== AGENTE DE IA - TOGGLE ===== */
.agente-toggle {
    padding: 20px 24px;
    background: linear-gradient(165deg, rgba(139, 92, 246, 0.12), rgba(139, 92, 246, 0.04));
    border-radius: var(--radius-md);
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    user-select: none;
}

.toggle-switch input {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 52px;
    height: 28px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    transition: var(--transition);
    flex-shrink: 0;
}

.toggle-slider::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 22px;
    height: 22px;
    background: #fff;
    border-radius: 50%;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.toggle-switch input:checked + .toggle-slider::after {
    transform: translateX(24px);
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.toggle-label i {
    color: #8b5cf6;
    font-size: 18px;
}

/* ===== AGENTE DE IA - SEÇÃO ===== */
.agente-section {
    display: none;
    animation: slideDown 0.3s ease-out;
}

.agente-section.is-visible {
    display: block;
}

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

.agente-card {
    border-color: rgba(139, 92, 246, 0.25);
    background: linear-gradient(165deg, rgba(139, 92, 246, 0.08), rgba(139, 92, 246, 0.02));
    overflow: hidden;
}

.agente-icon {
    background: rgba(139, 92, 246, 0.2) !important;
    color: #8b5cf6 !important;
}

.agente-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 8px;
    width: 100%;
    max-width: 100%;
}

.agente-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.agente-field--full {
    grid-column: 1 / -1;
    overflow: hidden;
}

.agente-field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.input-currency {
    display: flex;
    align-items: center;
    height: 48px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.25);
    overflow: hidden;
    transition: var(--transition);
}

.input-currency:focus-within {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.25);
}

.input-currency span {
    padding: 0 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    height: 100%;
    display: flex;
    align-items: center;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.input-currency input {
    flex: 1;
    height: 100%;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    padding: 0 14px;
    outline: none;
}

.agente-field textarea {
    width: 100%;
    max-width: 100%;
    min-height: 100px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.25);
    box-sizing: border-box;
    color: var(--text-primary);
    padding: 14px 16px;
    font-size: 14px;
    font-family: var(--font-family);
    line-height: 1.5;
    resize: vertical;
    transition: var(--transition);
    white-space: pre-wrap;
    word-wrap: break-word;
}

.agente-field textarea:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.25);
}

.agente-field textarea::placeholder {
    color: var(--text-muted);
}

/* ===== SUMMARY - AGENTE ROWS ===== */
.summary-row--agente {
    display: none;
    padding-top: 14px;
    border-top: 1px dashed rgba(139, 92, 246, 0.3);
}

.summary-row--agente.is-visible {
    display: flex;
}

.summary-row--agente strong {
    color: #a78bfa;
}

/* ===== SUMMARY - SETUP SECTION ===== */
.summary-setup {
    display: none;
    padding: 20px;
    border-radius: var(--radius-md);
    background: linear-gradient(145deg, rgba(139, 92, 246, 0.12), rgba(139, 92, 246, 0.04));
    border: 1px solid rgba(139, 92, 246, 0.2);
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.summary-setup.is-visible {
    display: flex;
}

.summary-setup__label {
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: center;
    justify-content: center;
}

.summary-setup__icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(139, 92, 246, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #a78bfa;
}

.summary-setup__label strong {
    font-size: 14px;
    font-weight: 700;
    color: #a78bfa;
}

.summary-setup__value {
    font-size: 24px;
    font-weight: 800;
    color: #a78bfa;
}

/* Mobile adjustments for agent section */
@media (max-width: 600px) {
    .agente-fields {
        grid-template-columns: 1fr;
    }

    .agente-field--full {
        grid-column: 1;
    }
}

/* ===== VALIDAÇÃO VISUAL ===== */
.form-field input.is-invalid {
    border-color: #f87171;
    box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.25);
}

.form-field input.is-valid {
    border-color: #34d399;
    box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.2);
}
