/*
 *  rh_manager - Sistema de Gestión de Recursos Humanos
 *  Copyright (C) 2026  Leonardo Pacheco (pleonardo84)
 *  form.css - Estilos de formularios
 *  Versión 0.8.0
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Affero General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Affero General Public License for more details.
 *
 *  You should have received a copy of the GNU Affero General Public License
 *  along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */
:root {
  --accent-color: #3b82f6;
  --accent-hover: #2563eb;
}

body {
  font-family: 'Nunito', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  margin: 0;
  padding: 20px;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  background: var(--surface-color);
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

h2 {
  border-bottom: 2px solid var(--accent-color);
  padding-bottom: 10px;
  color: var(--accent-color);
  margin-top: 0;
}

label {
  font-weight: bold;
  margin-bottom: 5px;
  font-size: 14px;
}

input, select, textarea {
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  font-size: 14px;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent-color);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-color) 20%, transparent);
}

.btn-save {
  background: var(--accent-color);
  color: white;
}

.btn-save:hover {
  background: var(--accent-hover);
}

/* ─── Label flotante (estilo ZWSOFT) ─────────────────────────────────────── */
.fl-field {
  position: relative;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  min-height: 58px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.fl-field:focus-within {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-color) 15%, transparent);
}

.fl-field .fl-label {
  position: absolute;
  top: 19px;
  left: 14px;
  max-width: calc(100% - 28px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 0;
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.2;
  pointer-events: none;
  z-index: 1;
  transition: all 0.2s ease;
}

.fl-field input,
.fl-field select,
.fl-field textarea {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 24px 14px 6px;
  border: none;
  border-radius: 10px;
  background: transparent;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text-primary);
  line-height: 1.35;
}

.fl-field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  cursor: pointer;
}

.fl-field select::-ms-expand {
  display: none;
}

.fl-field:has(select)::after {
  content: "\25BE";
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  color: var(--text-secondary);
  pointer-events: none;
}

.fl-field input:focus,
.fl-field select:focus,
.fl-field textarea:focus {
  outline: none;
  border: none;
  box-shadow: none;
}

.fl-field:focus-within .fl-label,
.fl-field.has-value .fl-label {
  top: 9px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.fl-field:focus-within .fl-label {
  color: var(--accent-color);
}

.fl-field.has-value:not(:focus-within) .fl-label {
  color: var(--text-secondary);
}

.fl-field .text-muted {
  margin: 0 14px 8px;
  font-size: 0.72rem;
}

/* Los campos de fecha/hora muestran el placeholder nativo (dd/mm/aaaa, --:--):
   el label se mantiene siempre flotado para no superponerse. */
.fl-field:has(input[type="date"]) .fl-label,
.fl-field:has(input[type="time"]) .fl-label {
  top: 9px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}

.fl-field:has(input[type="date"]):focus-within .fl-label,
.fl-field:has(input[type="time"]):focus-within .fl-label {
  color: var(--accent-color);
}
