/* ============================================================ */
/* Bolivia Imports — Formulario cliente público                  */
/* Design tokens: Premium Slate Ops  |  Claro + Oscuro auto      */
/* ============================================================ */

/* --- Tokens: modo claro --------------------------------------- */
:root {
  --bg:             #F1F4F7;
  --surface:        #FFFFFF;
  --surface-2:      #E9EEF2;
  --surface-3:      #DCE3E9;
  --border:         #D5DBE2;
  --border-strong:  #BDC5CE;
  --text:           #0F1419;
  --text-2:         #475260;
  --text-3:         #7D8896;
  --accent:         #3F6E7E;
  --accent-2:       #2D5566;
  --accent-soft:    #DCE7EB;
  --success:        #3D6B58;
  --success-soft:   #DCE7E1;
  --danger:         #8E443C;
  --danger-soft:    #EFD8D3;
  --shadow-sm:      0 1px 2px rgba(15,20,25,.04), 0 1px 8px rgba(15,20,25,.04);
  --shadow-md:      0 2px 4px rgba(15,20,25,.05), 0 4px 16px rgba(15,20,25,.06);
}

/* --- Tokens: modo oscuro -------------------------------------- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:             #0B1014;
    --surface:        #13191F;
    --surface-2:      #1A2128;
    --surface-3:      #232C34;
    --border:         #252F38;
    --border-strong:  #374350;
    --text:           #E2E8EE;
    --text-2:         #98A4B0;
    --text-3:         #5E6B77;
    --accent:         #6FA4B7;
    --accent-2:       #9CC8D8;
    --accent-soft:    #1A2A30;
    --success:        #6E9E89;
    --success-soft:   #162018;
    --danger:         #B8675D;
    --danger-soft:    #2A1714;
    --shadow-sm:      0 1px 2px rgba(0,0,0,.32), 0 2px 8px rgba(0,0,0,.24);
    --shadow-md:      0 2px 4px rgba(0,0,0,.36), 0 6px 18px rgba(0,0,0,.28);
  }
}

/* --- Reset ---------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* --- Body ----------------------------------------------------- */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 24px 16px 56px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Contenedor ----------------------------------------------- */
.container {
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* --- Header --------------------------------------------------- */
.header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 20px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  text-align: center;
  margin-bottom: 2px;
}

.logo img {
  height: 46px;
  width: auto;
  object-fit: contain;
  display: block;
}

.form-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-3);
}

/* --- Card ----------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}

.card--error {
  border-color: var(--danger);
  background: var(--danger-soft);
}

/* --- Meta row (pedido / cliente) ------------------------------ */
.meta-row {
  display: flex;
  gap: 20px;
}

.meta-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.meta-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text-3);
}

.meta-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Labels --------------------------------------------------- */
label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
  letter-spacing: .01em;
}

/* --- Inputs --------------------------------------------------- */
input:not([type=radio]):not([type=file]),
textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 12px 14px;
  font-size: 15px;
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: border-color 80ms ease-out, box-shadow 80ms ease-out, background 80ms ease-out;
  -webkit-appearance: none;
  min-height: 48px;
  box-shadow: var(--shadow-sm);
}

input:not([type=radio]):not([type=file])::placeholder,
textarea::placeholder {
  color: var(--text-3);
}

input:not([type=radio]):not([type=file]):focus,
textarea:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-sm);
}

input:not([type=radio]):not([type=file]):disabled,
textarea:disabled {
  opacity: .45;
  cursor: not-allowed;
}

/* --- Textarea ------------------------------------------------- */
textarea {
  resize: none;
  min-height: 88px;
}

/* --- Field group --------------------------------------------- */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* --- Radio buttons (custom pill) ------------------------------ */
.radio-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text-3);
  margin-bottom: 10px;
}

.radio-group {
  display: flex;
  gap: 8px;
}

.radio-group label {
  flex: 1;
  margin: 0;
  cursor: pointer;
}

/* Ocultar input real */
.radio-group input[type=radio] {
  display: none;
}

/* Pill visual */
.radio-group span {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 48px;
  padding: 10px 8px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: background 120ms ease-out, border-color 120ms ease-out, color 120ms ease-out;
  user-select: none;
}

.radio-group label:hover span {
  border-color: var(--accent);
  color: var(--text);
}

.radio-group input[type=radio]:checked + span {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

/* Deshabilitar toda interacción cuando el form está bloqueado */
.radio-group input[type=radio]:disabled + span {
  opacity: .45;
  cursor: not-allowed;
}

/* --- File upload --------------------------------------------- */
.file-upload {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.file-upload input[type=file] {
  display: none;
}

.file-label {
  background: var(--accent);
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 120ms ease-out;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  letter-spacing: .01em;
  user-select: none;
}

.file-label::before {
  content: "📎";
  font-size: 14px;
}

.file-label:hover {
  opacity: .88;
}

.file-name {
  font-size: 13px;
  color: var(--text-3);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-quitar {
  width: auto;
  margin: 0;
  padding: 7px 13px;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 100ms ease-out, color 100ms ease-out;
  min-height: unset;
  flex-shrink: 0;
  font-family: inherit;
}

.btn-quitar:hover {
  background: var(--surface-3);
  color: var(--text);
}

.btn-quitar:disabled {
  opacity: .4;
  cursor: not-allowed;
}

/* --- Botón principal ------------------------------------------ */
button[type=submit] {
  width: 100%;
  margin-top: 6px;
  padding: 16px;
  border-radius: 12px;
  border: none;
  background: var(--accent);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 120ms ease-out, transform 80ms ease-out;
  min-height: 52px;
  letter-spacing: .04em;
  text-transform: uppercase;
  box-shadow: 0 2px 14px rgba(63,110,126,.22);
}

button[type=submit]:hover:not(:disabled) {
  opacity: .88;
}

button[type=submit]:active:not(:disabled) {
  transform: translateY(1px);
}

button[type=submit]:disabled {
  opacity: .5;
  cursor: not-allowed;
}

button[type=submit].btn--success {
  background: var(--success);
  box-shadow: 0 2px 14px rgba(61,107,88,.22);
  opacity: 1;
  cursor: default;
}

/* --- Mensaje de estado inline --------------------------------- */
.status-msg {
  margin-top: 10px;
  padding: 13px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
}

.status-ok {
  background: var(--success-soft);
  border: 1px solid var(--success);
  color: var(--success);
}

.status-error {
  background: var(--danger-soft);
  border: 1px solid var(--danger);
  color: var(--danger);
}

/* --- Footer --------------------------------------------------- */
.footer {
  text-align: center;
  margin-top: 16px;
  font-size: 11px;
  color: var(--text-3);
  letter-spacing: .03em;
}

/* --- Hidden --------------------------------------------------- */
.hidden {
  display: none !important;
}

/* --- Toast ---------------------------------------------------- */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--text);
  color: var(--bg);
  padding: 11px 20px;
  border-radius: 99px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 4px 18px rgba(0,0,0,.18);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease-out, transform 200ms ease-out;
  max-width: calc(100vw - 32px);
  text-align: center;
  white-space: normal;
  line-height: 1.45;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* --- Responsive: tablet --------------------------------------- */
@media (min-width: 480px) {
  body {
    padding: 32px 24px 64px;
  }
  .container {
    gap: 12px;
  }
  .header {
    padding: 32px 28px 26px;
  }
  .logo img {
    height: 50px;
  }
  .card {
    padding: 20px 24px;
  }
}

/* --- Responsive: desktop -------------------------------------- */
@media (min-width: 768px) {
  body {
    padding: 48px 24px 72px;
  }
  .header {
    padding: 36px 32px 28px;
    border-radius: 16px;
  }
  .logo img {
    height: 54px;
  }
  .card {
    padding: 22px 28px;
    border-radius: 14px;
  }
  button[type=submit] {
    font-size: 14px;
  }
}
