@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

body {
  margin: 0;
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(to right, #f3f4f6, #e5e7eb);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.container {
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
  backdrop-filter: blur(7px);
  border-radius: 20px;
  width: 95%;
  max-width: 600px;
  padding: 40px 30px;
  animation: fadeIn 0.8s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.logo {
  display: block;
  margin: 0 auto 20px;
  width: 70px;
}

h1 {
  text-align: center;
  margin-bottom: 30px;
  color: #1f2937;
  font-weight: 600;
}

form {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

input[type="text"],
input[type="email"] {
  background: transparent;
  border: none;
  border-bottom: 2px solid #9ca3af;
  padding: 10px 5px;
  font-size: 16px;
  outline: none;
  transition: all 0.3s;
}

input:focus {
  border-color: #2563eb;
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

label {
  font-weight: 500;
  color: #374151;
}

canvas {
  width: 100%;
  height: 150px;
  border: 1px dashed #9ca3af;
  border-radius: 8px;
  background-color: #f9fafb;
}

button {
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.3s;
}

button:hover {
  transform: scale(1.03);
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3);
}

button#clear {
  background: linear-gradient(135deg, #6b7280, #4b5563);
}

@media screen and (max-width: 600px) {
  .container {
    padding: 30px 20px;
    border-radius: 0;
    min-height: 100vh;
    box-shadow: none;
  }

  .logo {
    width: 60px;
    margin-bottom: 15px;
  }

  h1 {
    font-size: 22px;
    margin-bottom: 25px;
  }

  label {
    font-size: 14px;
  }

  input[type="text"],
  input[type="email"] {
    font-size: 15px;
    padding: 10px 5px;
  }

  canvas {
    height: 130px;
  }

  button {
    font-size: 15px;
    padding: 12px;
    border-radius: 10px;
  }

  button#clear {
    margin-top: 10px;
  }

  .radio-group label {
    font-size: 14px;
  }
}

.spinner {
  border: 4px solid #f3f4f6;
  border-top: 4px solid #2563eb;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.fade-in {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease;
}

.fade-in.show {
  opacity: 1;
  max-height: 150px;
  margin-top: 20px;
}

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

/* ===== Modal ===== */
.modal {
  position: fixed; inset: 0; z-index: 50;
}
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(17, 24, 39, 0.45);
  backdrop-filter: blur(3px);
}
.modal-card {
  position: relative;
  max-width: 560px; width: 92%;
  margin: 8vh auto 0;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
  padding: 22px 22px 18px;
  animation: fadeIn .2s ease;
}
.modal-title {
  margin: 0 0 6px; color: #111827; font-size: 22px; font-weight: 600;
}
.modal-subtitle {
  margin: 0 0 12px; color: #374151; font-size: 14px;
}
.modal-list {
  margin: 0 0 12px 18px; padding: 0; color: #111827; font-size: 14px;
}
.modal-summary {
  background: #F9FAFB; border: 1px solid #E5E7EB; border-radius: 10px;
  padding: 10px 12px; font-size: 14px; color: #111827; margin-bottom: 12px;
}
.modal-consent {
  display: flex; gap: 8px; align-items: flex-start; margin: 8px 0 14px; color: #111827; font-size: 14px;
}
.modal-actions {
  display: flex; gap: 10px; justify-content: flex-end;
}

/* Botones variantes (reutilizando tu estilo base de button) */
.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff; border: none; border-radius: 10px; padding: 12px 16px; font-weight: 600; cursor: pointer;
}
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.btn-secondary {
  background: linear-gradient(135deg, #6b7280, #4b5563);
  color: #fff; border: none; border-radius: 10px; padding: 12px 16px; font-weight: 600; cursor: pointer;
}

/* ===== Toasts ===== */
#toast-container {
  position: fixed; top: 16px; right: 16px; z-index: 60;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  min-width: 280px; max-width: 420px;
  background: #fff; border-radius: 12px; padding: 12px 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.15);
  font-size: 14px; color: #111827;
  display: flex; align-items: center; gap: 10px;
  border-left: 4px solid transparent;
  animation: fadeIn .15s ease;
}
.toast-success { border-left-color: #10B981; }
.toast-error   { border-left-color: #EF4444; }

/* ===== Success card ===== */
.success-card {
  margin-top: 20px;
  padding: 22px;
  border-radius: 14px;
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  color: #064E3B;
}
.success-card h2 {
  margin: 0 0 8px; font-size: 22px; font-weight: 700;
}
.success-card p { margin: 6px 0; }

@media (max-width: 600px) {
  .modal-card { margin-top: 6vh; padding: 18px; }
}

/* ===== Scroll lock cuando modal / overlay están visibles (sin position:fixed) ===== */
html.scroll-lock, body.scroll-lock { overflow: hidden !important; }

/* ===== Modal centrado siempre ===== */
.modal { position: fixed; inset: 0; z-index: 50; display: none; align-items: center; justify-content: center; padding: 16px; }
.modal:not(.hidden) { display: flex; }
.modal-card { margin: 0; max-height: 90vh; overflow: auto; }

/* ===== Botón con estado loading (Agree & Submit) ===== */
.btn-loading { position: relative; pointer-events: none; opacity: .8; }
.btn-loading::after {
  content: ""; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid transparent; border-top-color: #fff; border-right-color: #fff;
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  animation: spin .9s linear infinite;
}

/* ===== Overlay global de subida (z high) ===== */
.upload-overlay {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(4px);
}
.upload-overlay.hidden { display: none; }
.upload-card {
  background: #fff; border-radius: 16px; padding: 22px 20px; text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
  max-width: 520px; width: calc(100% - 32px);
}
.upload-card p { margin: 12px 0 6px; font-weight: 600; color:#111827; }
.upload-card small { color:#4b5563; }

/* Barra indeterminada del overlay */
.progress {
  width: 220px; height: 6px; background: #E5E7EB; border-radius: 9999px;
  overflow: hidden; margin: 10px auto 0;
}
.progress > i {
  display: block; height: 100%; width: 40%;
  background: linear-gradient(90deg,#2563eb,#60a5fa);
  animation: indeterminate 1.2s infinite;
}
@keyframes indeterminate {
  0%   { transform: translateX(-100%); }
  50%  { transform: translateX(20%); }
  100% { transform: translateX(100%); }
}

/* Botón cancelar del overlay */
#cancel-upload.btn-secondary { margin-top: 12px; }
/* Mensaje debajo del título principal al enviar con éxito */
.hero-subtitle {
  text-align: center;
  color: #6b7280;          /* gris suave */
  margin-top: -6px;
  margin-bottom: 10px;
  font-size: 15px;
}
