:root {
    --bg-color: #050505;
    --surface-color: #121214;
    --surface-hover: #1e1e24;
    --border-color: #2a2a2e;
    --text-primary: #f8f8f8;
    --text-secondary: #a1a1aa;
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    --success: #10b981;
    --danger: #ef4444;
    --whatsapp: #25D366;
    --radius: 12px;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    padding: 20px 5%;
    border-bottom: 1px solid var(--border-color);
    background: rgba(18, 18, 20, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand span {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.container {
    max-width: 1250px;
    margin: 40px auto;
    padding: 0 20px;
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 40px;
}

@media (max-width: 992px) {
    .container {
        grid-template-columns: 1fr;
    }
}

.config-panel {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
}

.card {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: #3f3f46;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row>* {
    flex: 1;
}

label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

select,
input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 14px 16px;
    background-color: var(--bg-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    outline: none;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.2s;
}

select:focus,
input:focus {
    border-color: var(--accent-primary);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.service-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    padding: 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.service-toggle:hover {
    border-color: #444;
}

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

.service-name {
    font-size: 14px;
    font-weight: 500;
}

.service-price {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #2a2a2e;
    transition: .3s;
    border-radius: 30px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    transition: .3s;
    border-radius: 50%;
}

input:checked+.slider {
    background: var(--accent-gradient);
}

input:checked+.slider:before {
    transform: translateX(20px);
}

/* Custom Services */
.btn {
    background-color: var(--bg-color);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    width: 100%;
    transition: all 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    border-color: var(--text-secondary);
    background-color: var(--surface-hover);
}

.btn-primary {
    background: var(--accent-gradient);
    border: none;
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    background: var(--accent-gradient);
}

.btn-whatsapp {
    background: var(--whatsapp);
    border: none;
    color: white;
}

.btn-whatsapp:hover {
    background: #20bd5a;
    border: none;
}

.btn-danger {
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background-color: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
}

.custom-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.btn-icon {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
    width: 44px;
    height: 44px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: 0.2s;
    flex-shrink: 0;
}

.btn-icon:hover {
    background-color: var(--danger);
    color: white;
}

/* Summary Panel */
.summary-panel {
    position: sticky;
    top: 100px;
    height: fit-content;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.summary-card {
    background: linear-gradient(180deg, var(--surface-color) 0%, #0a0a0c 100%);
    border: 1px solid #333;
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--accent-gradient);
}

.brand-print {
    display: none;
    text-align: center;
    margin-bottom: 20px;
    font-size: 28px;
    font-weight: bold;
}

.summary-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    border-bottom: 1px solid #333;
    padding-bottom: 15px;
}

.summary-list {
    list-style: none;
    margin-bottom: 25px;
    min-height: 150px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    padding: 10px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
}

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

.summary-item .name {
    color: var(--text-secondary);
}

.summary-item .val {
    font-weight: 500;
}

.timeline-box {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.timeline-box svg {
    color: var(--accent-primary);
}

.total-box {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.total-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.total-value {
    font-size: 32px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

footer {
    text-align: center;
    padding: 30px;
    color: #555;
    font-size: 14px;
    margin-top: auto;
}

/* Impressão / PDF */
@media print {
    body {
        background: white !important;
        color: black !important;
    }

    * {
        color: black !important;
        text-shadow: none !important;
        -webkit-text-fill-color: black !important;
    }

    .config-panel,
    header,
    footer,
    .action-buttons,
    .btn,
    .btn-icon,
    .timeline-box svg {
        display: none !important;
    }

    .container {
        display: block;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .summary-panel {
        position: static;
        width: 100%;
    }

    .summary-card {
        background: white !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
    }

    .summary-card::before {
        display: none !important;
    }

    .brand-print {
        display: block !important;
        border-bottom: 2px solid #000;
        padding-bottom: 15px;
        margin-bottom: 25px;
        text-align: left;
    }

    .client-info-print {
        display: block !important;
    }

    .termos-print {
        display: block !important;
    }

    .signature-box {
        display: block !important;
    }

    .total-box {
        background: #f3f4f6 !important;
        border: 1px solid #e5e7eb !important;
        padding: 25px !important;
        margin-top: 30px !important;
    }

    .total-value {
        color: #000 !important;
        font-size: 36px !important;
    }

    .summary-title {
        border-bottom: 2px solid #eee !important;
        padding-bottom: 10px !important;
        font-size: 20px !important;
        color: #000 !important;
    }

    .summary-item {
        border-bottom: 1px solid #f0f0f0 !important;
        padding: 12px 0 !important;
    }

    .summary-item .name {
        font-weight: 600 !important;
        font-size: 13px !important;
        color: #333 !important;
    }

    .summary-item .val {
        font-weight: 700 !important;
        font-size: 13px !important;
        color: #000 !important;
    }

    .timeline-box {
        background: #f5f5f5 !important;
        border: 1px solid #ddd !important;
    }
}

/* Melhorias UX: Toasts e Modais */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
}

.toast {
    background: rgba(18, 18, 20, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 14px 24px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    border-left: 4px solid var(--accent-primary);
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.success {
    border-left-color: var(--success);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.info {
    border-left-color: var(--accent-primary);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 30px;
    width: 90%;
    max-width: 400px;
    box-shadow: var(--shadow);
    transform: scale(0.9);
    transition: 0.3s ease;
    text-align: center;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-content h3 {
    font-size: 20px;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.modal-content p {
    font-size: 14px;
    margin-bottom: 25px;
    color: var(--text-secondary);
}

.modal-actions {
    display: flex;
    gap: 15px;
}