/* ========== Bitel Piloto — colores oficiales ========== */
:root {
  --bitel-yellow: #FFF200;
  --bitel-blue:   #03558B;
  --bitel-blue-dk:#023f68;
  --bitel-blue-lt:#1170b7;
  --gray-1:  #f4f6f9;
  --gray-2:  #e6eaef;
  --gray-3:  #b8c1cc;
  --gray-4:  #6b7480;
  --gray-5:  #1e2733;
  --danger:  #d33a3a;
  --ok:      #1b8a4c;
  --radius:  10px;
  --shadow:  0 2px 8px rgba(3,85,139,0.10);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--gray-5);
  background: var(--gray-1);
  min-height: 100vh;
  padding-bottom: 100px;
}

/* Header */
.app-header {
  background: var(--bitel-blue);
  color: white;
  padding: 14px 16px 12px;
  position: sticky; top: 0; z-index: 10;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.app-header .row1 { display: flex; align-items: center; gap: 12px; }
.app-header .logo {
  background: var(--bitel-yellow);
  color: var(--bitel-blue);
  font-weight: 900;
  font-size: 20px;
  padding: 4px 10px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}
.app-header .titles { flex: 1; min-width: 0; }
.app-header h1 { font-size: 16px; font-weight: 700; margin: 0; line-height: 1.2; }
.app-header .subtitle { font-size: 12px; color: var(--bitel-yellow); opacity: 0.95; margin-top: 2px; }

/* Progreso */
.progress-wrap { padding: 12px 16px 0; }
.progress-bar { height: 6px; background: var(--gray-2); border-radius: 3px; overflow: hidden; }
.progress-bar > span { display: block; height: 100%; background: var(--bitel-yellow); width: 0; transition: width 0.3s; }
.progress-label { font-size: 11px; color: var(--gray-4); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.4px; }

/* Container */
.wizard { padding: 16px; max-width: 640px; margin: 0 auto; }

.card {
  background: white;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}

.section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--bitel-blue);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--bitel-yellow);
}
.section-hint { font-size: 12px; color: var(--gray-4); margin: -6px 0 12px; }

/* Form controls */
label { display: block; font-size: 13px; font-weight: 600; color: var(--gray-5); margin-bottom: 6px; }
label .req { color: var(--danger); margin-left: 3px; }

input[type=text], input[type=date], input[type=datetime-local], input[type=number], select, textarea {
  width: 100%;
  padding: 12px 12px;
  font-size: 16px; /* evita zoom iOS */
  border: 1.5px solid var(--gray-2);
  border-radius: 8px;
  background: white;
  color: var(--gray-5);
  font-family: inherit;
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--bitel-blue); }
input[readonly] { background: var(--gray-1); color: var(--gray-4); }
textarea { resize: vertical; min-height: 80px; }

.field { margin-bottom: 14px; }

/* Segmented (BITEL vs ALQUILADO) */
.segmented { display: flex; gap: 8px; }
.segmented input { display: none; }
.segmented label {
  flex: 1;
  text-align: center;
  padding: 12px;
  border: 1.5px solid var(--gray-2);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: var(--gray-4);
  background: white;
  margin-bottom: 0;
  user-select: none;
}
.segmented input:checked + label {
  background: var(--bitel-blue);
  color: white;
  border-color: var(--bitel-blue);
}

/* Radio cards (tipo reporte) */
.radio-list { display: grid; gap: 8px; }
.radio-list input { display: none; }
.radio-list label {
  padding: 14px 14px 14px 44px;
  border: 1.5px solid var(--gray-2);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-5);
  position: relative;
  margin-bottom: 0;
  transition: all 0.15s;
}
.radio-list label::before {
  content: '';
  position: absolute;
  left: 14px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px;
  border: 2px solid var(--gray-3);
  border-radius: 50%;
  background: white;
}
.radio-list input:checked + label {
  border-color: var(--bitel-blue);
  background: #eef5fb;
  color: var(--bitel-blue);
}
.radio-list input:checked + label::before {
  border-color: var(--bitel-blue);
  background: radial-gradient(circle, var(--bitel-blue) 0 6px, white 7px 100%);
}

/* Photo capture */
.photo-slot {
  border: 2px dashed var(--gray-3);
  border-radius: 10px;
  padding: 24px 16px;
  text-align: center;
  background: var(--gray-1);
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  min-height: 140px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
}
.photo-slot:hover { border-color: var(--bitel-blue); background: #f0f6fb; }
.photo-slot.has-photo { border-style: solid; border-color: var(--ok); padding: 8px; background: white; }
.photo-slot input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* 2 botones: Tomar foto / Galería */
.photo-actions { display: flex; gap: 10px; width: 100%; justify-content: center; flex-wrap: wrap; }
.btn-photo {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  flex: 1 1 45%; min-width: 130px; max-width: 220px;
  padding: 14px 12px;
  font-size: 14px; font-weight: 700;
  border-radius: 8px; cursor: pointer;
  text-transform: uppercase; letter-spacing: .3px;
  transition: all 0.15s;
  position: relative;
}
.btn-photo-cam { background: var(--bitel-blue); color: white; border: 2px solid var(--bitel-blue); }
.btn-photo-cam:hover { background: var(--bitel-blue-dk); }
.btn-photo-gal { background: white; color: var(--bitel-blue); border: 2px solid var(--gray-2); }
.btn-photo-gal:hover { border-color: var(--bitel-blue); background: #f0f6fb; }
.btn-photo input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-slot .icon { font-size: 32px; color: var(--gray-4); }
.photo-slot .text { font-size: 13px; color: var(--gray-4); font-weight: 600; }
.photo-slot .hint { font-size: 11px; color: var(--gray-4); }
.photo-slot img { max-width: 100%; max-height: 220px; border-radius: 6px; display: block; }
.photo-slot .remove {
  position: absolute; top: 6px; right: 6px;
  background: rgba(0,0,0,0.65); color: white;
  border: none; border-radius: 50%; width: 28px; height: 28px;
  cursor: pointer; font-size: 14px; line-height: 1;
}
.photo-info { font-size: 11px; color: var(--gray-4); margin-top: 6px; text-align: center; }

/* GPS status */
.gps-box {
  background: var(--gray-1);
  border-radius: 8px;
  padding: 12px;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px;
}
.gps-box.ok { background: #e8f5ee; color: var(--ok); }
.gps-box.err { background: #fdecec; color: var(--danger); }
.gps-box .status { flex: 1; }
.gps-box button { flex: 0 0 auto; }

/* Buttons */
.btn {
  display: inline-block;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-family: inherit;
}
.btn-primary { background: var(--bitel-yellow); color: var(--bitel-blue); width: 100%; }
.btn-primary:hover { background: #ffe600; }
.btn-primary:disabled { background: var(--gray-2); color: var(--gray-4); cursor: not-allowed; }
.btn-secondary { background: white; color: var(--bitel-blue); border: 1.5px solid var(--bitel-blue); }
.btn-ghost { background: transparent; color: var(--gray-4); }
.btn-sm { padding: 8px 14px; font-size: 12px; }

/* Nav footer */
.nav-footer {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: white;
  padding: 12px 16px;
  border-top: 1px solid var(--gray-2);
  box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
  display: flex; gap: 8px;
  z-index: 5;
}
.nav-footer .btn { flex: 1; }

/* Success */
.success-screen {
  text-align: center;
  padding: 40px 24px;
}
.success-screen .checkmark {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--ok);
  color: white;
  font-size: 48px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px;
  animation: pop 0.4s cubic-bezier(0.2,0.7,0.4,1.5);
}
@keyframes pop { 0% { transform: scale(0); } 100% { transform: scale(1); } }
.success-screen h2 { color: var(--bitel-blue); margin: 0 0 8px; }
.success-screen p { color: var(--gray-4); margin: 0 0 24px; }
.success-screen .receipt {
  background: var(--gray-1); border-radius: 8px;
  padding: 14px; text-align: left; font-size: 13px;
  margin: 16px auto 24px; max-width: 400px;
}
.success-screen .receipt div { margin: 4px 0; }
.success-screen .receipt strong { color: var(--bitel-blue); }

/* Loader */
.loader-overlay {
  position: fixed; inset: 0;
  background: rgba(3,85,139,0.9);
  color: white;
  display: none; align-items: center; justify-content: center; flex-direction: column; gap: 16px;
  z-index: 100;
}
.loader-overlay.show { display: flex; }
.spinner {
  width: 48px; height: 48px;
  border: 4px solid rgba(255,255,255,0.25);
  border-top-color: var(--bitel-yellow);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Errors / toasts */
.field.error input, .field.error select, .field.error textarea { border-color: var(--danger); }
.field-error { color: var(--danger); font-size: 12px; margin-top: 4px; }

/* Hide/show */
.hidden { display: none !important; }

/* Multi-photo slot */
.multi-photo-wrap { padding: 8px; border: 1.5px dashed var(--gray-3); border-radius: 10px; background: var(--gray-1); }
.multi-photo-wrap .multi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 6px; margin-bottom: 8px; }
.multi-photo-wrap .multi-thumb { position: relative; border-radius: 6px; overflow: hidden; background: white; border: 1px solid var(--gray-2); }
.multi-photo-wrap .multi-thumb img { display: block; width: 100%; height: 88px; object-fit: cover; }
.multi-photo-wrap .multi-thumb .remove {
  position: absolute; top: 3px; right: 3px; background: rgba(0,0,0,0.7); color: white;
  border: none; border-radius: 50%; width: 22px; height: 22px; cursor: pointer; font-size: 12px; line-height: 1;
}
.multi-photo-wrap .multi-thumb .tinfo { font-size: 9px; color: var(--gray-4); padding: 2px 4px; text-align: center; }
.multi-photo-wrap .multi-add { display: inline-block; cursor: pointer; }

/* Info banner */
.info-banner {
  background: linear-gradient(135deg, var(--bitel-yellow) 0%, #ffea00 100%);
  color: var(--bitel-blue);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex; gap: 8px; align-items: flex-start;
}
