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

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

        .container {
            max-width: 700px;
            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, #d58d26 0%, #e1b171 100%);
            color: white;
            padding: 30px;
            text-align: center;
        }

        .header h1 {
            font-size: 28px;
            margin-bottom: 10px;
        }

        .header p {
            font-size: 16px;
            opacity: 0.9;
        }

        .tipo-sessao-badge {
            display: inline-block;
            margin-top: 15px;
            padding: 8px 20px;
            background: rgba(255, 255, 255, 0.2);
            border-radius: 20px;
            font-weight: bold;
            font-size: 14px;
            text-transform: uppercase;
        }

        .descricao-evento {
            background: #f8f9fa;
            padding: 20px;
            border-bottom: 3px solid #d58d26;
            font-size: 15px;
            color: #555;
            line-height: 1.8;
        }
        
        .descricao-evento b,
        .descricao-evento strong {
            color: #333;
            font-weight: 600;
        }
        
        .descricao-evento br {
            line-height: 1.8;
        }

        .form-content {
            padding: 40px 30px;
        }

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

        label {
            display: block;
            margin-bottom: 8px;
            font-weight: 600;
            color: #333;
            font-size: 14px;
        }

        label .required {
            color: #e74c3c;
            margin-left: 3px;
        }

        input[type="text"],
        input[type="email"],
        input[type="tel"],
        select,
        textarea,
        input[type="file"] {
            width: 100%;
            padding: 12px 15px;
            border: 2px solid #d58d26;
            border-radius: 8px;
            font-size: 15px;
            transition: all 0.3s;
            font-family: inherit;
        }

        input[type="text"]:focus,
        input[type="email"]:focus,
        input[type="tel"]:focus,
        select:focus,
        textarea:focus {
            outline: none;
            border-color: #d58d26;
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
        }

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

        select {
            cursor: pointer;
            background-color: white;
        }

        .empresa-group {
            display: none;
            animation: slideDown 0.3s ease;
        }

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

        .file-upload-wrapper {
            position: relative;
            overflow: hidden;
            display: inline-block;
            width: 100%;
        }

        .file-upload-wrapper input[type="file"] {
            font-size: 100px;
            position: absolute;
            left: 0;
            top: 0;
            opacity: 0;
            cursor: pointer;
        }

        .file-upload-label {
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 15px;
            border: 2px dashed #d58d26;
            border-radius: 8px;
            background: #f8f9ff;
            cursor: pointer;
            transition: all 0.3s;
        }

        .file-upload-label:hover {
            background: #eef1ff;
            border-color: #d58d26;
        }

        .file-upload-label svg {
            width: 24px;
            height: 24px;
            margin-right: 10px;
            fill: #d58d26;
        }

        .file-name {
            margin-top: 10px;
            font-size: 13px;
            color: #666;
            font-style: italic;
        }

        .help-text {
            font-size: 13px;
            color: #666;
            margin-top: 5px;
        }

        .error {
            color: #e74c3c;
            font-size: 13px;
            margin-top: 5px;
            display: none;
        }

        .submit-btn {
            width: 100%;
            padding: 15px;
            background: linear-gradient(135deg, #d58d26 0%, #e1b171 100%);
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
            text-transform: uppercase;
            letter-spacing: 1px;
        }

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

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

        .submit-btn:disabled {
            background: #95a5a6;
            cursor: not-allowed;
            transform: none;
        }

        /* Feedback visual de campos válidos/inválidos */
        input:not([type="checkbox"]):not([type="file"]):not([type="hidden"]):focus,
        textarea:focus,
        select:focus {
            outline: none;
            border-color: #d58d26;
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
        }

        /* Borda verde para campos válidos */
        input.valid:not([type="checkbox"]):not([type="file"]),
        textarea.valid,
        select.valid {
            border-color: #28a745 !important;
        }

        /* Borda vermelha para campos inválidos */
        input.invalid:not([type="checkbox"]):not([type="file"]),
        textarea.invalid,
        select.invalid {
            border-color: #dc3545 !important;
        }

        .loading {
            display: none;
            text-align: center;
            margin-top: 20px;
        }

        .loading-spinner {
            border: 3px solid #f3f3f3;
            border-top: 3px solid #d58d26;
            border-radius: 50%;
            width: 40px;
            height: 40px;
            animation: spin 1s linear infinite;
            margin: 0 auto;
        }

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

        .error-message {
            padding: 15px 20px;
            border-radius: 8px;
            margin-bottom: 20px;
            display: none;
            background: #f8d7da;
            border: 1px solid #f5c6cb;
            color: #721c24;
        }

        /* Modal Genérico (para errorModal) */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.6);
            z-index: 9999;
            animation: fadeIn 0.3s ease;
        }

        .modal-content {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: white;
            border-radius: 15px;
            padding: 40px;
            max-width: 500px;
            width: 90%;
            z-index: 10000;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
            animation: slideUp 0.4s ease;
            text-align: center;
        }

        .modal-success {
            display: none;
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: white;
            border-radius: 15px;
            padding: 40px;
            max-width: 500px;
            width: 90%;
            z-index: 10001;  /* ← CORRIGIDO (maior que overlay) */
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
            animation: slideUp 0.4s ease;
            text-align: center;  /* ← ADICIONAR se não existir */
        }

        @keyframes slideUp {
            from {
                opacity: 0;
                transform: translate(-50%, -40%);
            }
            to {
                opacity: 1;
                transform: translate(-50%, -50%);
            }
        }

        .modal-content .close {
            position: absolute;
            top: 15px;
            right: 20px;
            font-size: 28px;
            font-weight: bold;
            cursor: pointer;
            color: #999;
            transition: color 0.3s;
            line-height: 1;
        }

        .modal-content .close:hover {
            color: #333;
        }

        .modal-content h2 {
            font-size: 24px;
            margin-bottom: 15px;
        }

        .modal-content p {
            color: #666;
            line-height: 1.6;
            margin-bottom: 25px;
            font-size: 16px;
            white-space: pre-line;
        }

        .modal-content button {
            background: linear-gradient(135deg, #d58d26 0%, #764ba2 100%);
            color: white;
            border: none;
            padding: 12px 30px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 16px;
            font-weight: 600;
            transition: opacity 0.3s;
        }

        .modal-content button:hover {
            opacity: 0.9;
        }

        /* Modal de Sucesso */
        .modal-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.6);
            z-index: 9998;
            animation: fadeIn 0.3s ease;
        }

        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        .modal-success {
            display: none;
            position: fixed;
            flex-direction: column;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: white;
            border-radius: 15px;
            padding: 40px;
            max-width: 500px;
            width: 90%;
            z-index: 10001;  /* ← CORRIGIDO (maior que overlay) */
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
            animation: slideUp 0.4s ease;
            text-align: center;  /* ← ADICIONAR se não existir */
        }

        @keyframes slideUp {
            from {
                opacity: 0;
                transform: translate(-50%, -40%);
            }
            to {
                opacity: 1;
                transform: translate(-50%, -50%);
            }
        }

        .modal-success .icon-check {
            width: 80px;
            height: 80px;
            margin: 0 auto 20px;
            background: linear-gradient(135deg, #d58d26 0%, #764ba2 100%);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .modal-success .icon-check svg {
            width: 50px;
            height: 50px;
            fill: white;
        }

        .modal-success h2 {
            text-align: center;
            color: #333;
            margin-bottom: 15px;
            font-size: 24px;
        }

        .modal-success p {
            text-align: center;
            color: #666;
            line-height: 1.6;
            margin-bottom: 25px;
        }

        .modal-success .btn-close {
            width: 100%;
            padding: 12px;
            background: linear-gradient(135deg, #d58d26 0%, #764ba2 100%);
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
        }

        .modal-success .btn-close:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
        }

        /* Modal de Erro */
        .modal-error {
            display: none;
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: white;
            border-radius: 15px;
            padding: 40px;
            max-width: 500px;
            width: 90%;
            z-index: 10001;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
            animation: slideUp 0.4s ease;
            text-align: center;
        }

        .modal-error .icon-error {
            width: 80px;
            height: 80px;
            margin: 0 auto 20px;
            background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            animation: shake 0.5s ease;
        }

        @keyframes shake {
            0%, 100% { transform: translateX(0); }
            25% { transform: translateX(-10px); }
            75% { transform: translateX(10px); }
        }

        .modal-error .icon-error svg {
            width: 45px;
            height: 45px;
            fill: white;
        }

        .modal-error h2 {
            color: #dc3545;
            margin-bottom: 15px;
            font-size: 24px;
        }

        .modal-error p {
            color: #666;
            line-height: 1.6;
            margin-bottom: 25px;
            font-size: 16px;
        }

        .modal-error .btn-close-error {
            background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
            color: white;
            border: none;
            padding: 12px 40px;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
        }

        .modal-error .btn-close-error:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(220, 53, 69, 0.4);
        }

        /* Modal RGPD */
        .modal-rgpd {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: white;
            border-radius: 15px;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
            z-index: 10001;
            max-width: 700px;
            width: 90%;
            max-height: 85vh;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            animation: slideUp 0.4s ease;
        }

        .modal-rgpd-header {
            background: linear-gradient(135deg, #d58d26 0%, #764ba2 100%);
            color: white;
            padding: 25px 30px;
            position: relative;
        }

        .modal-rgpd-header h2 {
            margin: 0;
            font-size: 22px;
            padding-right: 40px;
        }

        .modal-close-rgpd {
            position: absolute;
            top: 15px;
            right: 20px;
            font-size: 32px;
            cursor: pointer;
            color: white;
            line-height: 1;
            transition: transform 0.2s;
        }

        .modal-close-rgpd:hover {
            transform: scale(1.2);
        }

        .modal-rgpd-content {
            padding: 30px;
            overflow-y: auto;
            flex: 1;
        }

        .modal-rgpd-content h3 {
            color: #d58d26;
            margin-top: 25px;
            margin-bottom: 10px;
            font-size: 16px;
        }

        .modal-rgpd-content p {
            margin-bottom: 15px;
            line-height: 1.7;
            color: #333;
        }

        .modal-rgpd-content ul {
            margin-left: 20px;
            margin-bottom: 15px;
        }

        .modal-rgpd-content li {
            margin-bottom: 8px;
            line-height: 1.6;
        }

        .rgpd-footer {
            background: #f0f0f0;
            padding: 15px;
            border-radius: 8px;
            margin-top: 20px;
        }

        .rgpd-footer p {
            margin: 0;
            color: #555;
        }

        .modal-rgpd-buttons {
            padding: 20px 30px;
            border-top: 1px solid #e0e0e0;
            display: flex;
            gap: 10px;
            justify-content: flex-end;
        }

        .btn-rgpd-aceitar,
        .btn-rgpd-fechar {
            padding: 12px 25px;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            font-size: 15px;
            font-weight: 600;
            transition: all 0.3s;
        }

        .btn-rgpd-aceitar {
            background: linear-gradient(135deg, #d58d26 0%, #764ba2 100%);
            color: white;
        }

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

        .btn-rgpd-fechar {
            background: #f0f0f0;
            color: #666;
        }

        .btn-rgpd-fechar:hover {
            background: #e0e0e0;
        }

        /* Checkbox RGPD personalizado */
        .rgpd-group {
            background: #f8f9fa;
            padding: 20px;
            border-radius: 8px;
            border: 2px solid #e0e0e0;
            margin-top: 30px;
        }

        .checkbox-container {
            display: flex;
            align-items: flex-start;
            cursor: pointer;
            font-size: 14px;
            line-height: 1.6;
            position: relative;
            padding-left: 35px;
            margin: 0;
        }

        .checkbox-container input[type="checkbox"] {
            position: absolute;
            opacity: 0;
            cursor: pointer;
            height: 0;
            width: 0;
        }

        .checkmark {
            position: absolute;
            top: 2px;
            left: 0;
            height: 22px;
            width: 22px;
            background-color: white;
            border: 2px solid #d58d26;
            border-radius: 4px;
            transition: all 0.3s;
        }

        .checkbox-container:hover input ~ .checkmark {
            background-color: #f0f0f0;
        }

        .checkbox-container input:checked ~ .checkmark {
            background: linear-gradient(135deg, #d58d26 0%, #764ba2 100%);
            border-color: #d58d26;
        }

        .checkmark:after {
            content: "";
            position: absolute;
            display: none;
        }

        .checkbox-container input:checked ~ .checkmark:after {
            display: block;
        }

        .checkbox-container .checkmark:after {
            left: 6px;
            top: 2px;
            width: 6px;
            height: 11px;
            border: solid white;
            border-width: 0 2px 2px 0;
            transform: rotate(45deg);
        }

        .checkbox-text {
            color: #333;
            display: inline;
        }

        .link-rgpd {
            color: #d58d26;
            text-decoration: underline;
            font-weight: 600;
            cursor: pointer;
        }

        .link-rgpd:hover {
            color: #764ba2;
        }

        .evento-nao-encontrado {
            text-align: center;
            padding: 60px 30px;
            color: #721c24;
        }

        .evento-nao-encontrado h2 {
            font-size: 24px;
            margin-bottom: 15px;
        }

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

            .header {
                padding: 20px 15px;
            }

            .header h1 {
                font-size: 22px;
            }

            .header p {
                font-size: 14px;
            }

            .form-content {
                padding: 25px 20px;
            }

            .modal-success {
                padding: 30px 20px;
            }
        }

        @media (max-width: 480px) {
            .header h1 {
                font-size: 20px;
            }

            input[type="text"],
            input[type="email"],
            input[type="tel"],
            select,
            textarea {
                font-size: 14px;
                padding: 10px 12px;
            }

            .submit-btn {
                font-size: 14px;
                padding: 12px;
            }
        }

/* ========================================
   ESTILOS ADICIONAIS - Novos Campos V2
   ======================================== */

/* Campos condicionais - animação suave */
.form-group[id$="Group"] {
    transition: all 0.3s ease;
}

/* Destaque para campos condicionais */
.conditional-field {
    background: #f8f9ff;
    padding: 15px;
    border-left: 3px solid #d58d26;
    border-radius: 5px;
    margin-top: 10px;
}

/* Select melhorado para instituições (lista longa) */
select[name="instituicao_id"] {
    max-height: 200px;
    overflow-y: auto;
}

/* Campo numérico - ano internato */
input[type="number"] {
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Badge de informação */
.info-badge {
    display: inline-block;
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    margin-left: 8px;
    font-weight: normal;
}

/* Grupo de campos médico */
#medicoTipoGroup,
#medicoEspecialidadeGroup,
#medicoAnoInternatoGroup {
    margin-left: 20px;
    border-left: 2px solid #e0e0e0;
    padding-left: 15px;
}

/* Labels dos subcampos */
#medicoTipoGroup label,
#medicoEspecialidadeGroup label,
#medicoAnoInternatoGroup label {
    font-size: 13px;
    color: #555;
}

/* Responsividade melhorada */
@media (max-width: 768px) {
    #medicoTipoGroup,
    #medicoEspecialidadeGroup,
    #medicoAnoInternatoGroup {
        margin-left: 10px;
        padding-left: 10px;
    }
}

/* Indicador de campo opcional */
.optional {
    color: #999;
    font-weight: normal;
    font-size: 12px;
    margin-left: 5px;
}

/* Select com ícone de seta melhorado */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23667eea' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

/* Campo de grupo profissional destaque */
#grupo_profissional {
    border: 2px solid #d58d26;
    font-weight: 500;
}

/* Campo de instituição destaque */
#instituicao_id {
    border: 2px solid #d58d26;
    font-weight: 500;
}

/* Transição suave ao mostrar campos */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-group[style*="block"] {
    animation: fadeIn 0.3s ease;
}
