/* =========================================
   UTILITIES.CSS - Clases utilitarias
   Clínica Santa Teresa - CST
   ========================================= */

/* --- Display y layout --- */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }
.d-grid { display: grid !important; }

.flex-column { flex-direction: column !important; }
.flex-row { flex-direction: row !important; }
.justify-center { justify-content: center !important; }
.justify-between { justify-content: space-between !important; }
.align-center { align-items: center !important; }
.gap-sm { gap: var(--spacing-sm) !important; }
.gap-md { gap: var(--spacing-md) !important; }
.gap-lg { gap: var(--spacing-lg) !important; }

/* --- Espaciado --- */
.m-0 { margin: 0 !important; }
.mt-sm { margin-top: var(--spacing-sm) !important; }
.mt-md { margin-top: var(--spacing-md) !important; }
.mt-lg { margin-top: var(--spacing-lg) !important; }
.mb-sm { margin-bottom: var(--spacing-sm) !important; }
.mb-md { margin-bottom: var(--spacing-md) !important; }
.mb-lg { margin-bottom: var(--spacing-lg) !important; }

.p-sm { padding: var(--spacing-sm) !important; }
.p-md { padding: var(--spacing-md) !important; }
.p-lg { padding: var(--spacing-lg) !important; }

/* --- Texto --- */
.text-center { text-align: center !important; }
.text-muted { color: var(--color-text-muted) !important; }
.text-error { color: var(--color-error) !important; }
.text-success { color: var(--color-success) !important; }
.fw-bold { font-weight: 700 !important; }
.fw-normal { font-weight: 400 !important; }

/* --- Visibilidad accesible --- */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* --- Bordes y sombras --- */
.rounded { border-radius: var(--border-radius) !important; }
.rounded-lg { border-radius: var(--border-radius-lg) !important; }
.shadow { box-shadow: var(--box-shadow) !important; }
.shadow-hover:hover { box-shadow: var(--box-shadow-hover) !important; }

/* --- Estados interactivos --- */
.disabled {
  opacity: 0.6 !important;
  pointer-events: none !important;
  cursor: not-allowed !important;
}

/* --- Responsive utilities --- */
@media (max-width: 768px) {
  .d-none-mobile { display: none !important; }
  .d-block-mobile { display: block !important; }
  .text-center-mobile { text-align: center !important; }
}

@media (min-width: 769px) {
  .d-none-desktop { display: none !important; }
}

/* =========================================
UTILIDADES PARA REGISTRO
========================================= */

.form-section {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
    background: #fafafa;
}

.form-section legend {
    font-weight: 600;
    color: var(--primary);
    padding: 0 10px;
    font-size: 1.1rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9rem;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin-top: 3px;
    cursor: pointer;
}

.checkbox-label span a {
    color: var(--primary);
    text-decoration: none;
}

.checkbox-label span a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    .form-section {
        padding: 12px;
    }
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hidden { display: none !important; }