/* Reset e configurações gerais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --primary: #2c3e50;
    --secondary: #3498db;
    --accent: #e74c3c;
    --success: #27ae60;
    --warning: #f39c12;
    --light: #ecf0f1;
    --dark: #2c3e50;
    --gray: #95a5a6;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --radius: 8px;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1500px;
    margin: 0 auto;
}

/* Header */
.header {
    background: linear-gradient(to right, var(--primary), var(--secondary));
    color: white;
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent);
}

.header h1 {
    font-size: 2.2rem;
    margin-bottom: 5px;
    font-weight: 700;
}

.header p {
    opacity: 0.9;
    font-size: 1.1rem;
}

/* Formulário */
.form-container {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 30px;
    margin-bottom: 30px;
}

.section {
    margin-bottom: 30px;
    border: 1px solid #e1e8ed;
    padding: 25px;
    border-radius: var(--radius);
    background: #fafbfc;
    transition: all 0.3s ease;
}

.section:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.section h3 {
    margin-top: 0;
    color: var(--primary);
    font-size: 1.4rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--secondary);
    display: flex;
    align-items: center;
}

.section h3::before {
    content: "▶";
    margin-right: 10px;
    color: var(--secondary);
    font-size: 0.9rem;
}

/* Grupos de formulário */
.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--primary);
    font-size: 0.95rem;
}

input, select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e8ed;
    border-radius: var(--radius);
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Checkbox groups */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: white;
    border: 2px solid #e1e8ed;
    border-radius: var(--radius);
    transition: all 0.3s ease;
    cursor: pointer;
}

.checkbox-item:hover {
    border-color: var(--secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.checkbox-item input[type="checkbox"] {
    width: auto;
    margin-right: 12px;
    transform: scale(1.2);
}

.checkbox-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    font-weight: 500;
    cursor: pointer;
}

.price {
    color: var(--success);
    font-weight: 700;
    font-size: 1rem;
}

/* Botões - TAMANHOS ORGANIZADOS */
.btn {
    background: linear-gradient(to right, var(--secondary), var(--primary));
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: var(--shadow);
    text-decoration: none;
    text-align: center;
    min-height: 44px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

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

/* Botão principal grande */
.btn-submit {
    background: linear-gradient(to right, var(--success), #2ecc71);
    width: 100%;
    margin-top: 20px;
    padding: 16px 30px;
    font-size: 1.1rem;
    min-height: 54px;
}

.btn-submit::after {
    content: "💈";
    font-size: 1.2rem;
}

/* Botão secundário médio */
.btn-secondary {
    background: linear-gradient(to right, var(--warning), #e67e22);
    padding: 10px 20px;
    font-size: 0.95rem;
    min-height: 40px;
}

/* Botão pequeno para ações */
.btn-small {
    padding: 8px 16px;
    font-size: 0.85rem;
    min-height: 36px;
    gap: 6px;
}

/* Botão de exportar/relatório */
.btn-exportar {
    background: linear-gradient(to right, #e74c3c, #c0392b);
    padding: 12px 25px;
    font-size: 1rem;
    min-height: 44px;
}

/* Botão de voltar */
.back-button {
    background: #95a5a6;
    margin-bottom: 20px;
    text-decoration: none;
    padding: 10px 20px;
    font-size: 0.95rem;
    min-height: 40px;
}

.back-button:hover {
    background: #7f8c8d;
    color: white;
    text-decoration: none;
}

/* Botão de imprimir específico */
.btn-imprimir {
    background: #3498db;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    text-decoration: none;
    display: inline-block;
    transition: background 0.3s;
    min-height: 32px;
    line-height: 1.2;
}

.btn-imprimir:hover {
    background: #2980b9;
}

/* Grupo de botões */
.btn-group {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.btn-group .btn {
    flex: 1;
    min-width: 140px;
    max-width: 200px;
}

/* Status e feedback */
.alert {
    padding: 15px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-weight: 500;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Cards de informações */
.info-card {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    border-left: 4px solid var(--secondary);
}

.info-card h4 {
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

/* Responsividade */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .form-container {
        padding: 20px;
    }
    
    .section {
        padding: 20px;
    }
    
    .checkbox-group {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .btn-group {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-group .btn {
        width: 100%;
        max-width: 280px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.95rem;
    }
    
    .btn-submit {
        padding: 14px 25px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .section h3 {
        font-size: 1.2rem;
    }
    
    .btn {
        padding: 10px 18px;
        font-size: 0.9rem;
        min-height: 40px;
    }
    
    .btn-submit {
        padding: 12px 20px;
        font-size: 0.95rem;
        min-height: 48px;
    }
    
    .btn-small {
        padding: 6px 12px;
        font-size: 0.8rem;
        min-height: 32px;
    }
    
    .btn-imprimir {
        padding: 5px 10px;
        font-size: 0.75rem;
        min-height: 28px;
    }
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-container {
    animation: fadeIn 0.6s ease-out;
}

/* Estados dos checkboxes */
input[type="checkbox"]:checked + .checkbox-label {
    color: var(--success);
    font-weight: 600;
}

.checkbox-item:has(input[type="checkbox"]:checked) {
    border-color: var(--success);
    background: #f0f9f4;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--secondary);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Loading state */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--secondary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Customização do Select2 */
.select2-container--default .select2-selection--single {
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    height: 50px;
    padding: 0px 12px;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 50px;
    padding-left: 0;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 44px;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #3498db;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 2px solid #e1e8ed;
    border-radius: 6px;
}

/* Campos de quantidade e desconto */
.quantity-input, .discount-input {
    width: 80px;
    text-align: center;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.item-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 8px;
}

.control-label {
    font-size: 0.8rem;
    color: #666;
    margin-right: 5px;
}

/* Layout específico para controles */
.checkbox-item {
    flex-direction: column;
    align-items: flex-start;
}

.checkbox-item .checkbox-label {
    margin-bottom: 8px;
}

.form-compact {
    margin: 0 auto;
}

/* Classes utilitárias para tamanhos de botão */
.btn-xs {
    padding: 4px 8px;
    font-size: 0.7rem;
    min-height: 24px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    min-height: 32px;
}

.btn-md {
    padding: 10px 20px;
    font-size: 0.95rem;
    min-height: 40px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1.1rem;
    min-height: 50px;
}

.btn-xl {
    padding: 16px 32px;
    font-size: 1.2rem;
    min-height: 56px;
}