/* ============================================
   Autorização Exame Médico - v3 Clean Design
   ============================================ */

:root {
    --primary: #0d6e3f;
    --primary-dark: #054823;
    --primary-light: #e8f5ee;
    --accent: #ff6b35;
    --danger: #dc3545;
    --warning: #f0ad4e;
    --success: #28a745;
    --gray-50: #f8f9fa;
    --gray-100: #f1f3f5;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    --border-radius: 8px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,.15);
    --transition: all .2s ease;
}

/* Layout - fundo unico branco */
#content.fullWidth,
#content.fullWidth .slice,
#content.fullWidth .container,
#content.fullWidth .color4 {
    background: #fff !important;
}

.v3-container {
    max-width: 1160px;
    margin: 0 auto;
    padding: 24px 20px 40px;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 16px;
    color: var(--gray-800);
    background: #fff;
}

.v3-header {
    text-align: center;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 3px solid var(--primary);
}

.v3-header h1 {
    font-size: 26px;
    font-weight: 700;
    color: var(--primary-dark);
    margin: 0 0 4px;
}

.v3-header .v3-subtitle {
    font-size: 17px;
    color: var(--gray-500);
    margin: 0;
}

/* Cards / Fieldsets */
.v3-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    box-shadow: none;
    overflow: hidden;
}

.v3-card-header {
    background: var(--primary-light);
    padding: 12px 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 8px;
}

.v3-card-header h2 {
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--primary-dark);
    margin: 0;
    letter-spacing: 0.5px;
}

.v3-card-header .v3-step-number {
    width: 26px;
    height: 26px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.v3-card-body {
    padding: 20px;
}

/* Form Grid */
.v3-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.v3-row:last-child {
    margin-bottom: 0;
}

.v3-col {
    flex: 1;
    min-width: 0;
}

.v3-col-2 { flex: 2; }
.v3-col-3 { flex: 3; }
.v3-col-auto { flex: 0 0 auto; }

/* Labels */
.v3-label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 5px;
}

.v3-label .v3-required {
    color: var(--danger);
    margin-left: 2px;
}

/* Inputs */
.v3-input,
.v3-select,
.v3-textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 16px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    background: #fff;
    color: var(--gray-800);
    transition: var(--transition);
    box-sizing: border-box;
    outline: none;
}

.v3-input:focus,
.v3-select:focus,
.v3-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 110, 63, .12);
}

.v3-input::placeholder {
    color: var(--gray-400);
}

.v3-select {
    height: 42px;
    cursor: pointer;
}

.v3-textarea {
    min-height: 80px;
    resize: vertical;
}

.v3-input:disabled,
.v3-select:disabled {
    background: var(--gray-100);
    cursor: not-allowed;
}

/* Validation Messages */
.v3-msg-error {
    color: var(--danger);
    font-size: 14px;
    margin-top: 4px;
    display: block;
}

.v3-msg-success {
    color: var(--success);
    font-size: 14px;
    margin-top: 4px;
    display: block;
}

/* Radio Buttons */
.v3-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.v3-radio-item {
    position: relative;
}

.v3-radio-item input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.v3-radio-item label {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    border: 2px solid var(--gray-300);
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    color: var(--gray-700);
    cursor: pointer;
    transition: var(--transition);
    background: #fff;
    user-select: none;
}

.v3-radio-item label:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.v3-radio-item input[type="radio"]:checked + label {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.v3-radio-item input[type="radio"]:disabled + label {
    opacity: 0.5;
    cursor: not-allowed;
}

.v3-radio-item input[type="radio"]:checked:disabled + label {
    opacity: 1;
    cursor: default;
}

/* Buttons */
.v3-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    gap: 6px;
}

.v3-btn-primary {
    background: var(--primary);
    color: #fff;
}

.v3-btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-md);
}

.v3-btn-outline {
    background: #fff;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.v3-btn-outline:hover {
    background: var(--primary-light);
}

.v3-btn-danger {
    background: var(--danger);
    color: #fff;
}

.v3-btn-sm {
    padding: 8px 16px;
    font-size: 14px;
}

.div-cargo,
.div-setor {
    display: flex;
    flex-direction: column;
}

.div-cargo .v3-btn-sm,
.div-setor .v3-btn-sm {
    align-self: flex-start;
    margin-top: 8px;
}

.v3-btn-lg {
    padding: 16px 44px;
    font-size: 18px;
    min-width: 320px;
}

.v3-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: v3spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

@keyframes v3spin {
    to { transform: rotate(360deg); }
}

.v3-btn:disabled,
.v3-btn.v3-disabled {
    opacity: 0.4;
    pointer-events: none;
    cursor: not-allowed;
}

.v3-btn.v3-btn-loading {
    opacity: 0.85;
    pointer-events: none;
    cursor: wait;
}

/* Submit Area */
.v3-submit-area {
    text-align: center;
    padding: 24px 0;
}

/* Alerts */
.v3-alert {
    padding: 16px 20px;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.v3-alert-success {
    background: var(--primary-light);
    border: 1px solid var(--primary);
    color: var(--primary-dark);
}

.v3-alert-error {
    background: #fde8ea;
    border: 1px solid var(--danger);
    color: #721c24;
}

.v3-alert-warning {
    background: #fff8e1;
    border: 1px solid var(--warning);
    color: #856404;
}

/* Info Box (Popup replacement) */
.v3-info-box {
    background: linear-gradient(135deg, var(--primary-light), #fff);
    border: 1px solid var(--primary);
    border-radius: var(--border-radius);
    padding: 24px;
    margin: 20px 0;
    text-align: center;
}

.v3-info-box h3 {
    color: var(--primary-dark);
    font-size: 20px;
    margin: 0 0 12px;
}

.v3-info-box p {
    color: var(--gray-700);
    font-size: 16px;
    line-height: 1.6;
    margin: 0 0 8px;
}

.v3-info-box .v3-signature {
    margin-top: 16px;
    font-weight: 700;
    color: var(--primary-dark);
}

/* Print Button */
.v3-print-area {
    text-align: center;
    margin: 24px 0;
}

.v3-btn-print {
    background: var(--primary-dark);
    color: #fff;
    padding: 16px 44px;
    font-size: 18px;
    border-radius: var(--border-radius);
    border: none;
    cursor: pointer;
    font-weight: 700;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
}

.v3-btn-print:hover {
    background: var(--primary);
    box-shadow: var(--shadow-md);
    color: #fff;
}

/* New Position/Sector Panel */
.v3-panel-novo {
    background: var(--gray-50);
    border: 1px dashed var(--gray-400);
    border-radius: var(--border-radius);
    padding: 16px;
    margin-top: 12px;
}

.v3-panel-novo h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--primary-dark);
    margin: 0 0 12px;
    text-transform: uppercase;
}

.v3-panel-novo .v3-notice {
    font-size: 14px;
    color: var(--warning);
    font-weight: 600;
    margin-top: 8px;
    padding: 8px;
    background: #fff8e1;
    border-radius: 4px;
}

/* Unit Info */
.v3-unit-info {
    margin-top: 12px;
}

.v3-unit-horario {
    color: var(--accent);
    font-weight: 600;
    font-size: 15px;
}

.v3-unit-endereco {
    color: var(--primary);
    font-size: 15px;
    margin-top: 4px;
}

/* Docs Required */
.v3-docs-list {
    list-style: none;
    padding: 0;
    margin: 8px 0;
}

.v3-docs-list li {
    padding: 6px 0 6px 24px;
    position: relative;
    font-size: 15px;
    color: var(--gray-700);
}

.v3-docs-list li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: 700;
}

/* File Upload */
.v3-file-upload {
    margin-top: 12px;
}

.v3-file-upload input[type="file"] {
    font-size: 15px;
}

/* RH Notice */
.v3-rh-notice {
    background: #fff8e1;
    border-left: 4px solid var(--warning);
    padding: 12px 16px;
    font-size: 15px;
    color: var(--gray-700);
    line-height: 1.5;
    margin-top: 12px;
    border-radius: 0 6px 6px 0;
}

/* Gestao Badge */
.v3-gestao-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    margin-top: 8px;
}

.v3-gestao-sim {
    background: var(--primary-light);
    color: var(--primary-dark);
}

.v3-gestao-nao {
    background: var(--gray-100);
    color: var(--gray-500);
}

/* Anular popup antigo do site global */
.v3-container .popup,
.v3-container .popup2,
.v3-container .overlay {
    display: none !important;
}

/* Overlay / Modal */
.v3-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.v3-overlay.v3-active {
    display: flex;
}

.v3-modal {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    max-width: 560px;
    width: 90%;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 10000;
    animation: v3FadeIn .25s ease;
}

@keyframes v3FadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.v3-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--gray-100);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.v3-modal-close:hover {
    background: var(--gray-300);
}

/* Esconde modal_aviso antigo dentro da v3 */
#modal-pop-up-03 {
    display: none !important;
}

/* Credenciada fields */
.v3-credenciada-row {
    display: none;
}

.v3-credenciada-row.v3-active {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

/* Hide/Show helpers */
.v3-hidden {
    display: none !important;
}

/* Select2 - estilizar igual v3-select */
.v3-container .select2-container {
    width: 100% !important;
}

.v3-container .select2-container .select2-choice,
.v3-container .select2-container--default .select2-selection--single {
    height: 42px;
    padding: 10px 14px;
    font-size: 16px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    background: #fff;
    color: var(--gray-800);
    transition: var(--transition);
    box-sizing: border-box;
    outline: none;
    display: flex;
    align-items: center;
}

.v3-container .select2-container .select2-choice:hover,
.v3-container .select2-container--default .select2-selection--single:hover {
    border-color: var(--primary);
}

.v3-container .select2-container--default .select2-selection--single:focus,
.v3-container .select2-container--open .select2-selection--single {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(13, 110, 63, .12);
}

.v3-container .select2-container--default .select2-selection--single .select2-selection__rendered {
    padding: 0;
    line-height: normal;
    color: var(--gray-800);
    font-size: 16px;
}

.v3-container .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px;
    right: 8px;
}

/* Select2 v3 compat */
.v3-container .select2-container .select2-choice .select2-arrow {
    background: none;
    border: none;
}

.v3-container .select2-container .select2-choice > .select2-chosen {
    font-size: 16px;
    color: var(--gray-800);
}

/* Select2 dropdown - itens compactos */
.select2-drop .select2-results li,
.select2-results__option {
    padding: 6px 12px !important;
    font-size: 15px;
    line-height: 1.3;
    margin: 0 !important;
}

.select2-drop .select2-results li.select2-highlighted,
.select2-results__option--highlighted {
    background: var(--primary) !important;
    color: #fff !important;
}

.select2-drop .select2-search input,
.select2-search__field {
    padding: 6px 10px !important;
    font-size: 15px;
    border: 1px solid var(--gray-300) !important;
    border-radius: 4px;
}

.select2-drop {
    border: 1px solid var(--gray-300);
    border-radius: 0 0 6px 6px;
    box-shadow: var(--shadow-md);
}

/* Video - Responsive 16:9 embed */
.v3-video-section {
    max-width: 640px;
    margin: 0 auto 28px;
    background: var(--gray-900);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.v3-video-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
}

.v3-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .v3-container {
        padding: 16px 12px;
    }

    .v3-row {
        flex-direction: column;
        gap: 12px;
    }

    .v3-radio-group {
        flex-direction: column;
    }

    .v3-btn-lg {
        min-width: unset;
        width: 100%;
    }

    .v3-modal {
        width: 95%;
        padding: 20px;
    }
}
