:root {
    /* Colors */
    --bg-main: #121212;
    --bg-card: #1E1E1E;
    --bg-input: #292929;
    --gold-primary: #f2d00d;
    --gold-hover: #e0be00;
    --gold-muted: rgba(242, 208, 13, 0.15);
    --gold-border: rgba(242, 208, 13, 0.4);
    --text-main: #F5F5F5;
    --text-muted: #A0A0A0;
    --danger: #ff4d4f;
    --success: #4caf50;

    /* Typography */
    --font-heading: 'Playfair Display', serif;
    --font-ui: 'Manrope', sans-serif;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-ui);
    min-height: 100vh;
}

/* Layout */
.app-container {
    display: flex;
    flex-direction: column;
    max-width: 960px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
    gap: 1.5rem;
}

.form-section {
    flex: 2;
    padding-right: 1rem;
    max-width: 800px;
}

.summary-section {
    width: 100%;
    margin-top: 2rem;
}

/* Typography */
h1, h2, h3 {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--gold-primary);
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 2rem;
    padding: 0 1rem;
    gap: 1rem;
}

.clinic-logo {
    max-height: 100px;
    object-fit: contain;
}

.header-text {
    flex-grow: 1;
    text-align: left;
}

.app-header h1 {
    font-size: 2rem;
    margin-bottom: 0.2rem;
}

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

/* Tabs */
.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--bg-input);
}

.tab-button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-family: var(--font-ui);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
}

.tab-button:hover {
    color: var(--text-main);
}

.tab-button.active {
    color: var(--gold-primary);
    border-bottom: 2px solid var(--gold-primary);
}

.procedure-list {
    display: none;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.procedure-list.active-tab {
    display: flex;
}

/* Procedure Row */
.procedure-item {
    background: var(--bg-card);
    border: 1px solid var(--gold-border);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.procedure-item:hover {
    border-color: var(--gold-primary);
    box-shadow: 0 4px 15px var(--gold-muted);
}

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

.procedure-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.procedure-price {
    color: var(--gold-primary);
    font-weight: 700;
    font-size: 0.95rem;
    margin-top: 0.2rem;
}

.quantity-control {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #333;
}

.qty-btn {
    background: transparent;
    border: none;
    color: var(--text-main);
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.qty-btn:hover {
    background: var(--gold-primary);
    color: #000;
}

.qty-input {
    width: 40px;
    text-align: center;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: var(--font-ui);
    font-weight: 600;
    font-size: 1rem;
    -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Additionals Checkboxes */
.additionals-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.checkbox-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.checkbox-item {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    padding: 1rem 1.2rem;
    border-radius: 12px;
    border: 1px solid #333;
    cursor: pointer;
    transition: all 0.2s;
}

.checkbox-item:hover {
    border-color: var(--gold-border);
}

.checkbox-item input[type="checkbox"] {
    appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid var(--gold-primary);
    border-radius: 4px;
    margin-right: 12px;
    display: grid;
    place-content: center;
    cursor: pointer;
}

.checkbox-item input[type="checkbox"]::before {
    content: "";
    width: 12px;
    height: 12px;
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    box-shadow: inset 1em 1em var(--gold-primary);
    transform-origin: center;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.checkbox-item input[type="checkbox"]:checked::before {
    transform: scale(1);
}

/* Summary Card */
.summary-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid var(--gold-border);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.summary-card h2 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    text-align: center;
}

.summary-treatments {
    max-height: 250px;
    overflow-y: auto;
    margin-bottom: 1.5rem;
    padding-right: 0.5rem;
}

.summary-treatments::-webkit-scrollbar {
    width: 6px;
}
.summary-treatments::-webkit-scrollbar-thumb {
    background: var(--gold-border);
    border-radius: 3px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.summary-item .qty {
    color: var(--gold-primary);
    font-weight: bold;
    margin-right: 8px;
}

.empty-state {
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
    padding: 1rem 0;
}

.divider {
    height: 1px;
    background: var(--bg-input);
    margin: 1.5rem 0;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

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

.price-regular {
    text-decoration: line-through;
}

.price-discounted {
    font-size: 2rem;
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--gold-primary);
}

.savings {
    background: var(--gold-muted);
    padding: 0.8rem 1rem;
    border-radius: 8px;
    color: var(--gold-primary);
    font-weight: 700;
}

/* Buttons */
.btn {
    font-family: var(--font-ui);
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.btn-large {
    width: 100%;
    padding: 1.2rem;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 1.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold-primary), #b08d00);
    color: #000;
    box-shadow: 0 4px 15px rgba(242, 208, 13, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #ffe242, var(--gold-primary));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(242, 208, 13, 0.5);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-main);
    padding: 0.8rem 1.5rem;
}

.btn-secondary:hover {
    background: #444;
}

.btn-spanish {
    background: linear-gradient(135deg, #00b09b, #006f64);
    color: #fff;
    padding: 0.8rem 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 176, 155, 0.3);
}

.btn-spanish:hover {
    background: linear-gradient(135deg, #00cdb3, #00b09b);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 176, 155, 0.5);
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold-primary), #b08d00);
    color: #000;
}

.btn-gold:hover {
    background: linear-gradient(135deg, #ffe242, var(--gold-primary));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(242, 208, 13, 0.4);
}

.btn-outline-gold {
    background: transparent;
    border: 1px solid var(--gold-primary);
    color: var(--gold-primary);
}

.btn-outline-gold:hover {
    background: var(--gold-muted);
    color: var(--gold-primary);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: var(--bg-card);
    border: 1px solid var(--gold-border);
    border-radius: 16px;
    padding: 2.5rem;
    width: 90%;
    max-width: 700px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}

.close {
    position: absolute;
    top: 1.5rem;
    right: 2rem;
    color: var(--text-muted);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}

.close:hover {
    color: var(--gold-primary);
}

.modal-content h2 {
    margin-bottom: 0.5rem;
}

.modal-content > p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

#quote-textarea {
    width: 100%;
    height: 350px;
    background: var(--bg-main);
    color: var(--text-main);
    border: 1px solid #333;
    border-radius: 8px;
    padding: 1rem;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    resize: none;
    margin-bottom: 1.5rem;
}

#quote-textarea:focus {
    outline: 1px solid var(--gold-primary);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

@media (max-width: 1024px) {
    .app-container {
        flex-direction: column;
    }
    .summary-section {
        position: static;
        max-width: 100%;
    }
}
