@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;600;700&family=Montserrat:wght@500;600&family=Raleway:wght@600;700&family=Rubik:wght@500;600;700&display=swap');

:root {
  --color-primary: #061D9B;
  --color-primary-light: rgba(6, 29, 155, 0.06);
  --color-accent: #D4AF37;
  --color-bg: #F8F9FA;
  --color-surface: #FFFFFF;
  --color-text: #1A1D20;
  --color-text-muted: #64748B;
  --color-border: #E2E8F0;
  --color-success: #10B981;
  --color-error: #EF4444;

  --font-title: 'Rubik', sans-serif;
  --font-subtitle: 'Raleway', sans-serif;
  --font-body: 'Lato', sans-serif;
  --font-extra: 'Montserrat', sans-serif;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Encabezado */
header {
  background-color: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 1.25rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-container {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  height: 32px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  display: block;
}

.save-badge {
  font-size: 0.75rem;
  font-family: var(--font-extra);
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.save-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--color-success);
}

/* Contenedor Principal */
main {
  flex: 1;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem 1rem;
}

/* Indicador de Pasos (Ghost Active State) */
.stepper-nav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.step-indicator {
  flex: 1;
  padding: 0.6rem 0.5rem;
  background-color: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  text-align: center;
  font-family: var(--font-subtitle);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted);
  transition: all 0.2s ease;
}

.step-indicator.active {
  background-color: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-primary);
  border-left-width: 3px;
}

.step-indicator.completed {
  border-color: var(--color-success);
  color: var(--color-success);
}

/* Bloques y Tarjetas */
.card-section {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.section-title {
  font-family: var(--font-title);
  font-size: 1.1rem;
  color: var(--color-primary);
  margin-bottom: 0.25rem;
}

.section-desc {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
}

/* Campos de Formulario */
.form-group {
  margin-bottom: 1rem;
}

label {
  display: block;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.35rem;
}

.required {
  color: var(--color-error);
}

input, select {
  width: 100%;
  min-height: 48px;
  padding: 0.65rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--color-text);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s;
}

input:focus, select:focus {
  border-color: var(--color-primary);
}

input[readonly], select:disabled {
  background-color: var(--color-bg);
  color: var(--color-text-muted);
  cursor: not-allowed;
}

/* Checklist de Documentos (Solo Lectura) */
.doc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.85rem;
}
.doc-item:last-child {
  border-bottom: none;
}

.badge-doc {
  font-size: 0.75rem;
  font-family: var(--font-extra);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}
.badge-received {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--color-success);
}
.badge-pending {
  background-color: rgba(212, 175, 55, 0.15);
  color: #B8860B;
}

/* Canvas de Firma */
.signature-box {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-sm);
  background-color: #FFFFFF;
  position: relative;
  touch-action: none;
  margin-top: 0.5rem;
}

canvas#signatureCanvas {
  width: 100%;
  height: 180px;
  display: block;
}

.signature-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.btn-link {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  text-decoration: underline;
  cursor: pointer;
}

/* Botones de Navegación */
.nav-buttons {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn {
  flex: 1;
  min-height: 48px;
  border-radius: var(--radius-sm);
  font-family: var(--font-subtitle);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
}

.btn:active {
  opacity: 0.85;
}

.btn-primary {
  background-color: var(--color-primary);
  color: #FFFFFF;
}

.btn-secondary {
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.hidden {
  display: none !important;
}