/* ==============================================================================
FILE: apps/leave_form_app/static/forms/v1/leave_form.css
PROJECT: leave_form_app
ROLE: Estilos globales del frontend (v1).
============================================================================== */

/* apps/leave_form_app/static/forms/v1/leave_form.css */

body {
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f5f7;
  color: #1f2933;
}

.lf-wrapper {
  max-width: 1080px;
  margin: 32px auto;
  padding: 0 16px 40px;
}

.lf-header {
  margin-bottom: 24px;
}

.lf-header h1 {
  margin: 0;
  font-size: 1.8rem;
}

.lf-subtitle {
  margin: 4px 0 0;
  color: #6b7280;
  font-size: 0.95rem;
}

.lf-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 16px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.lf-login {
  margin-top: 12px;
}

.lf-note {
  margin-top: 0;
  font-size: 0.9rem;
  color: #6b7280;
}

.lf-demo-users {
  padding-left: 18px;
  margin-top: 4px;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.lf-login-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.lf-field {
  display: flex;
  flex-direction: column;
  flex: 1 1 200px;
  min-width: 180px;
}

.lf-field label {
  font-size: 0.85rem;
  margin-bottom: 4px;
  color: #374151;
}

.lf-field input,
.lf-field select,
.lf-field textarea {
  border-radius: 8px;
  border: 1px solid #d1d5db;
  padding: 8px 10px;
  font-size: 0.9rem;
  outline: none;
}

.lf-field textarea {
  resize: vertical;
}

.lf-field input:focus,
.lf-field select:focus,
.lf-field textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px #2563eb20;
}

/* Buttons */
.lf-btn {
  border-radius: 999px;
  border: none;
  padding: 8px 16px;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.lf-btn-primary {
  background: #2563eb;
  color: #ffffff;
}

.lf-btn-primary:hover {
  background: #1d4ed8;
}

.lf-btn-secondary {
  background: #e5e7eb;
  color: #111827;
}

.lf-btn-secondary:hover {
  background: #d1d5db;
}

.lf-btn:disabled,
.lf-btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

.lf-login-error {
  margin: 0;
  color: #b91c1c;
  font-size: 0.85rem;
}

.lf-current-user {
  font-size: 0.9rem;
  color: #374151;
}

/* Wizard */
.lf-wizard-steps {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 0.82rem;
}

.lf-step-indicator {
  padding: 6px 10px;
  border-radius: 999px;
  background: #e5e7eb;
  color: #4b5563;
}

.lf-step-active {
  background: #2563eb;
  color: #ffffff;
}

.lf-step-panel {
  display: none;
  margin-top: 8px;
}

.lf-step-panel-active {
  display: block;
}

.lf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.lf-wizard-actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.lf-review-block {
  background: #f9fafb;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.9rem;
  border: 1px solid #e5e7eb;
}

.lf-review-block dl {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 4px 12px;
}

.lf-review-block dt {
  font-weight: 600;
  color: #4b5563;
}

.lf-review-block dd {
  margin: 0;
  color: #111827;
}

.lf-help-text {
  margin-top: 10px;
  font-size: 0.85rem;
  color: #6b7280;
}

.lf-status-message {
  margin-top: 10px;
  font-size: 0.85rem;
}

/* Tables */
.lf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.lf-table thead {
  background: #f3f4f6;
}

.lf-table th,
.lf-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
}

.lf-table th {
  font-weight: 600;
  font-size: 0.8rem;
  color: #4b5563;
}

.lf-table tr:nth-child(even) td {
  background: #fafafa;
}

.lf-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
}

.lf-badge-pending {
  background: #fef3c7;
  color: #92400e;
}

.lf-badge-approved {
  background: #dcfce7;
  color: #166534;
}

.lf-badge-rejected {
  background: #fee2e2;
  color: #b91c1c;
}

.lf-empty {
  margin: 8px 0 0;
  font-size: 0.85rem;
  color: #6b7280;
}

/* =============================================================================
Segments UX (v1)
- Ajuste clave: grid soporta 5 bloques (Type + Dates + Time + Alloc + Actions)
============================================================================= */

.lf-seg-grid{
  display:grid;
  grid-template-columns: 1fr 1fr 1fr 1fr auto;
  gap:12px;
  align-items:start;
}

/* Wrapper row (si lo tienes en HTML) */
.lf-seg-row{
  margin-top: 10px;
}

.lf-seg-block{
  border:1px solid #e5e7eb;
  border-radius:10px;
  padding:10px;
  background:#fafafa;
}

.lf-seg-toggle{
  margin-bottom:8px;
}

.lf-seg-body{
  margin-top:6px;
}

.lf-seg-actions{
  display:flex;
  align-items:flex-start;
  justify-content:flex-end;
  padding-top:28px; /* alinea Remove con bloques sin saltar */
}

.lf-seg-inner-grid{
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap:10px;
}

/* Checkbox visual */
.lf-checkbox{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-size:0.85rem;
  color:#374151;
  user-select:none;
}

.lf-checkbox input{
  width:16px;
  height:16px;
}

/* Responsive */
@media (max-width: 900px){
  .lf-seg-grid{
    grid-template-columns: 1fr;
  }
  .lf-seg-actions{
    padding-top:0;
    justify-content:flex-start;
  }
}

/* =============================================================================
Inline validation styles
- FIX: .lf-invalid no es el input, es el contenedor .lf-field.
- Aplicar borde rojo al control dentro del field.
============================================================================= */

.lf-field.lf-invalid input,
.lf-field.lf-invalid select,
.lf-field.lf-invalid textarea {
  border-color: #c0392b !important;
  box-shadow: 0 0 0 1px rgba(192, 57, 43, 0.18);
}

.lf-error-text {
  margin-top: 6px;
  font-size: 12px;
  color: #c0392b;
  line-height: 1.2;
}

/* Si el HTML trae placeholders de error, por defecto ocultos */
.lf-error-text[hidden] {
  display: none !important;
}
