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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2em;
    margin-bottom: 10px;
}

header h2 {
    font-size: 1.2em;
    font-weight: 300;
    opacity: 0.9;
}

.progress-bar {
    display: flex;
    background: #f8f9fa;
    padding: 20px;
    justify-content: space-around;
    border-bottom: 2px solid #e9ecef;
}

.progress-step {
    flex: 1;
    text-align: center;
    padding: 15px;
    position: relative;
    color: #6c757d;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.progress-step:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -50%;
    top: 50%;
    width: 100%;
    height: 2px;
    background: #dee2e6;
    z-index: -1;
}

.progress-step.active {
    color: #667eea;
    font-weight: 700;
}

.progress-step.completed {
    color: #28a745;
}

.progress-step.active::before,
.progress-step.completed::before {
    content: attr(data-step);
    display: block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    margin: 0 auto 10px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    font-weight: bold;
}

.progress-step.completed::before {
    background: #28a745;
    content: '✓';
}

form {
    padding: 40px;
}

.form-section {
    display: none;
}

.form-section.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

.form-section h3 {
    color: #667eea;
    font-size: 1.8em;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 3px solid #667eea;
}

.subsection {
    margin-bottom: 40px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #667eea;
}

.subsection h4 {
    color: #495057;
    font-size: 1.3em;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #495057;
    font-weight: 600;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group input[type="number"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1em;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input[readonly] {
    background-color: #e9ecef;
    cursor: not-allowed;
}

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

.checkbox-group,
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 10px;
}

.checkbox-group label,
.radio-group label {
    display: flex;
    align-items: center;
    font-weight: 400;
    cursor: pointer;
    padding: 8px 15px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.checkbox-group label:hover,
.radio-group label:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.checkbox-group input[type="checkbox"],
.radio-group input[type="radio"] {
    margin-right: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.form-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e9ecef;
}

button {
    padding: 15px 40px;
    font-size: 1.1em;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-prev {
    background: #6c757d;
    color: white;
}

.btn-prev:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-next,
.btn-submit {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-next:hover,
.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-submit {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.btn-submit:hover {
    box-shadow: 0 5px 20px rgba(40, 167, 69, 0.4);
}

.resultado {
    padding: 40px;
    background: #f8f9fa;
}

.resultado h3 {
    color: #667eea;
    font-size: 2em;
    margin-bottom: 30px;
    text-align: center;
}

.export-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    margin-bottom: 30px;
}

.export-buttons button {
    padding: 12px 30px;
    font-size: 0.95em;
    background: #667eea;
    color: white;
}

.export-buttons button:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.prontuario-gerado {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-height: 600px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    line-height: 1.8;
}

.prontuario-gerado h2 {
    color: #667eea;
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 1.5em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 8px;
}

.prontuario-gerado h3 {
    color: #764ba2;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.prontuario-gerado p {
    margin-bottom: 10px;
}

.prontuario-gerado strong {
    color: #495057;
}

/* Responsividade */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        border-radius: 10px;
    }

    header h1 {
        font-size: 1.5em;
    }

    header h2 {
        font-size: 1em;
    }

    form {
        padding: 20px;
    }

    .form-section h3 {
        font-size: 1.4em;
    }

    .subsection {
        padding: 15px;
    }

    .subsection h4 {
        font-size: 1.1em;
    }

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

    .progress-bar {
        flex-direction: column;
        gap: 10px;
    }

    .progress-step:not(:last-child)::after {
        display: none;
    }

    .form-navigation {
        flex-direction: column;
        gap: 15px;
    }

    button {
        width: 100%;
    }

    .export-buttons {
        flex-direction: column;
    }

    .export-buttons button {
        width: 100%;
    }
}

/* Scrollbar personalizada */
.prontuario-gerado::-webkit-scrollbar {
    width: 10px;
}

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

.prontuario-gerado::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.prontuario-gerado::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}

/* Animações de carregamento */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Estilos de impressão */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .container {
        box-shadow: none;
    }

    .progress-bar,
    .export-buttons,
    .form-navigation,
    form {
        display: none;
    }

    .resultado {
        padding: 0;
        background: white;
    }

    .prontuario-gerado {
        max-height: none;
        overflow: visible;
        box-shadow: none;
    }
}
