/* =======================================================
   ESTILOS PREMIUM - CADASTRO DE DEPENDENTE AVULSO S1 SAÚDE
   Acessibilidade: <label> placeholder aria-label
   ======================================================= */


/* Estilos de Label para Acessibilidade e Auditoria */
label {
    display: block;
    margin-bottom: var(--space-xs);
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

/* Card Premium com efeito Glassmorphism suave */
.card-premium {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    box-shadow: var(--shadow-lg);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.card-premium:hover {
    border-color: var(--primary-light);
    box-shadow: 0 15px 35px -5px rgba(39, 42, 139, 0.2), 0 0 25px rgba(230, 0, 126, 0.1);
}

.card-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: var(--space-xl);
    line-height: 1.5;
}

/* Badge com dados do titular ativo */
.titular-info-badge {
    background: var(--primary-light);
    border: 1px solid rgba(230, 0, 126, 0.15);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.85rem;
    color: var(--primary);
    margin-bottom: var(--space-lg);
    font-weight: 500;
}

.badge-label {
    opacity: 0.8;
}

.badge-value {
    font-weight: 700;
}

.badge-separator {
    opacity: 0.3;
    margin: 0 var(--space-xs);
}

/* Grid de Slots e Dependentes */
.slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

/* Base dos Cartões de Slot */
.slot-card {
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 130px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

/* Slot Disponível (Vazio) */
.slot-vazio {
    border: 2px dashed var(--border);
    background: rgba(39, 42, 139, 0.02);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
}

.slot-vazio:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
}

.slot-add-icon {
    font-size: 2rem;
    font-weight: 300;
    margin-bottom: var(--space-xs);
}

.slot-add-text {
    font-size: 0.85rem;
    font-weight: 600;
}

/* Slot Ocupado (Dependente Ativo) */
.slot-ocupado {
    border: 1px solid var(--border);
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.slot-ocupado:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.dep-name-info {
    font-weight: 600;
    color: var(--secondary);
    font-size: 0.95rem;
    margin-bottom: var(--space-xs);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dep-cpf-info {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: monospace;
    margin-bottom: var(--space-xs);
}

.dep-parentesco-info {
    font-size: 0.75rem;
    background: var(--accent-light);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    display: inline-block;
    align-self: flex-start;
    font-weight: 600;
}

/* Ações no Cartão de Dependente */
.dep-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    margin-top: var(--space-md);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding-top: var(--space-sm);
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-muted);
    padding: var(--space-xs);
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn-icon-edit {
    color: #0284c7;
    font-weight: 600;
}

.btn-icon-edit:hover {
    background: rgba(2, 132, 199, 0.08);
    color: #0369a1;
}

.btn-icon-delete {
    color: #ef4444;
    font-weight: 600;
}

.btn-icon-delete:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
}

.btn-icon-delete:disabled {
    color: #cbd5e1 !important;
    opacity: 0.5;
    cursor: not-allowed;
}

/* Slot em Carência (Bloqueado por 60 dias) */
.slot-carencia {
    border: 1px solid rgba(245, 158, 11, 0.2);
    background: rgba(245, 158, 11, 0.03);
    color: var(--warning);
}

.slot-carencia-title {
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--warning);
    margin-bottom: var(--space-xs);
}

.slot-carencia-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

.slot-carencia-date {
    font-weight: 600;
    margin-top: var(--space-xs);
}

/* Formulário de Cadastro/Edição */
.form-cadastro-dependente {
    background: rgba(39, 42, 139, 0.01);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-top: var(--space-xl);
    animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.form-cadastro-dependente h3 {
    color: var(--secondary);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: var(--space-lg);
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: var(--space-xs);
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    margin-right: calc(var(--space-md) * -0.5);
    margin-left: calc(var(--space-md) * -0.5);
    margin-bottom: var(--space-md);
}

.col-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding-right: calc(var(--space-md) * 0.5);
    padding-left: calc(var(--space-md) * 0.5);
}

.col-12 {
    flex: 0 0 100%;
    max-width: 100%;
    padding-right: calc(var(--space-md) * 0.5);
    padding-left: calc(var(--space-md) * 0.5);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
    margin-top: var(--space-xl);
    border-top: 1px solid var(--border);
    padding-top: var(--space-lg);
}

/* Wizard Footer Actions */
.wizard-footer-actions {
    display: flex;
    justify-content: space-between;
    margin-top: var(--space-xl);
    border-top: 1px solid var(--border);
    padding-top: var(--space-lg);
}

/* Input especial com botão de validação inline */
.input-with-button {
    display: flex;
    gap: var(--space-md);
}

.input-with-button .input {
    flex: 1;
}

/* Sucesso / Conclusão */
.text-center {
    text-align: center;
}

.success-icon-container {
    display: flex;
    justify-content: center;
    margin-bottom: var(--space-lg);
}

.success-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--success);
    color: white;
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.3);
}

.success-title {
    color: var(--secondary);
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: var(--space-md);
}

.success-message {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    max-width: 500px;
    margin: 0 auto var(--space-xl) auto;
}

.instructions-card {
    background: rgba(39, 42, 139, 0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    max-width: 500px;
    margin: 0 auto var(--space-xl) auto;
    text-align: left;
}

.instructions-card h3 {
    color: var(--secondary);
    font-size: 1rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: var(--space-sm);
}

.instructions-card p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: var(--space-md);
}

.access-details {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.05);
    padding-bottom: var(--space-xs);
}

.detail-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.detail-row strong {
    color: var(--text-secondary);
}

.detail-row span {
    font-weight: 700;
    color: var(--primary);
    font-family: monospace;
}

.success-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
}

.btn-lg {
    padding: var(--space-md) var(--space-2xl);
    font-size: 1.1rem;
    min-width: 250px;
    text-align: center;
}

/* Spinner de carregamento inline */
.spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
    margin-left: var(--space-sm);
}

/* Toast Notification Styles */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--secondary);
    color: white;
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    font-size: 0.9rem;
    font-weight: 500;
    animation: slideIn 0.3s ease forwards;
    border-left: 4px solid var(--primary);
}

.toast.toast-error {
    border-left-color: var(--error);
}

.toast.toast-success {
    border-left-color: var(--success);
}

/* Keyframes */
@keyframes spin {
    to { transform: rotate(360deg); }
}

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

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

/* Ajustes Responsivos */
@media (max-width: 768px) {
    .col-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    .input-with-button {
        flex-direction: column;
    }
    .input-with-button .btn {
        width: 100%;
    }
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Opções de Matrícula no Modal */
.btn-matricula-option {
    width: 100%;
    padding: 14px 18px;
    text-align: left;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #ffffff;
    color: var(--secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    box-sizing: border-box;
}
.btn-matricula-option:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}
.btn-matricula-option:focus {
    outline: none;
    border-color: var(--primary);
}
