/* ============================================================
   shared.css — Orán Hoy · Formularios
   Diseño mobile-first, premium, con micro-animaciones
   ============================================================ */

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

:root {
  --blue:     #2563eb;
  --blue-dk:  #1d4ed8;
  --blue-lt:  #eff6ff;
  --blue-glow: rgba(37,99,235,0.15);
  --navy:     #1e293b;
  --dark:     #0f172a;
  --gray:     #64748b;
  --gray-lt:  #f8fafc;
  --border:   #e2e8f0;
  --white:    #ffffff;
  --red:      #ef4444;
  --green:    #22c55e;
  --green-lt: #f0fdf4;
  --radius:   14px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.06);
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--dark);
  color: var(--navy);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── Animations ──────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
@keyframes checkBounce {
  0% { transform: scale(0); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
@keyframes confetti {
  0% { transform: translateY(0) rotate(0); opacity: 1; }
  100% { transform: translateY(-60px) rotate(180deg); opacity: 0; }
}
@keyframes toastIn {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
@keyframes toastOut {
  from { transform: translateY(0); opacity: 1; }
  to   { transform: translateY(-100%); opacity: 0; }
}

/* ── Nav ─────────────────────────────────────────────────── */
nav {
  background: rgba(15,23,42,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding: 0 1.25rem;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}
.logo {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 2px;
}
.logo span { color: var(--blue); }
.nav-back {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  transition: all 0.2s;
}
.nav-back:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.05);
}

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--dark) 0%, #1e293b 50%, #1e3a5f 100%);
  color: white;
  text-align: center;
  padding: 2rem 1.5rem 2.5rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(37,99,235,0.1) 0%, transparent 70%);
  pointer-events: none;
}
.hero-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(37,99,235,0.15);
  border: 1px solid rgba(37,99,235,0.3);
  color: #93c5fd;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 24px;
  margin-bottom: 0.9rem;
  animation: fadeInUp 0.5s ease-out;
}
.hero h1 {
  position: relative;
  font-size: clamp(22px, 5vw, 30px);
  font-weight: 800;
  margin-bottom: 0.5rem;
  line-height: 1.2;
  animation: fadeInUp 0.5s ease-out 0.1s both;
}
.hero p {
  position: relative;
  font-size: 14px;
  color: #94a3b8;
  max-width: 400px;
  margin: 0 auto;
  line-height: 1.6;
  animation: fadeInUp 0.5s ease-out 0.2s both;
}

/* ── Steps indicator ─────────────────────────────────────── */
.steps-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 1.25rem;
  animation: fadeInUp 0.5s ease-out 0.3s both;
  position: relative;
}
.step-dot {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.35);
}
.step-dot.active { color: #93c5fd; }
.step-dot .num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1.5px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}
.step-dot.active .num {
  background: rgba(37,99,235,0.3);
  border-color: rgba(37,99,235,0.5);
  color: #93c5fd;
}
.step-line {
  width: 24px;
  height: 1.5px;
  background: rgba(255,255,255,0.1);
}

/* ── Main content ────────────────────────────────────────── */
.main {
  background: var(--gray-lt);
  border-radius: 20px 20px 0 0;
  margin-top: -10px;
  position: relative;
  z-index: 5;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
  padding: 1.75rem 1rem 4rem;
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  animation: fadeInUp 0.4s ease-out both;
}
.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.2s; }
.card:nth-child(5) { animation-delay: 0.25s; }

.card-head {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(180deg, rgba(248,250,252,0.5) 0%, transparent 100%);
}
.card-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--blue-lt);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--dark);
  letter-spacing: 0.01em;
}
.card-body { padding: 1.25rem; }

/* ── Fields ──────────────────────────────────────────────── */
.field { margin-bottom: 1.1rem; }
.field:last-child { margin-bottom: 0; }

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 6px;
}
.req { color: var(--blue); font-weight: 700; }
.opt { font-weight: 400; color: var(--gray); font-size: 11px; margin-left: 4px; }

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--white);
  color: var(--dark);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.field input::placeholder,
.field textarea::placeholder {
  color: #b0bec5;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-glow);
  background: var(--blue-lt);
}

.field textarea {
  resize: vertical;
  min-height: 110px;
  line-height: 1.6;
}
.field select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 5l3 3 3-3' fill='none' stroke='%2364748b' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 34px;
}

/* ── Grid layouts ────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.grid-4 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

@media (min-width: 520px) {
  .grid-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
}
@media (max-width: 380px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ── Tag selectors ───────────────────────────────────────── */
.tag-group { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  padding: 9px 16px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  background: var(--white);
  color: var(--gray);
  transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
  user-select: none;
  display: flex;
  align-items: center;
  gap: 6px;
  -webkit-tap-highlight-color: transparent;
}
.tag:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-lt);
}
.tag.active {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37,99,235,0.2);
}

/* ── Info box ────────────────────────────────────────────── */
.info-box {
  background: var(--blue-lt);
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: #1e40af;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 8px;
}

/* ── Upload zones ────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 1.75rem 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  position: relative;
  background: linear-gradient(180deg, var(--gray-lt) 0%, var(--white) 100%);
}
.upload-zone:hover,
.upload-zone.drag {
  border-color: var(--blue);
  background: var(--blue-lt);
  border-style: solid;
  box-shadow: 0 0 0 4px var(--blue-glow);
}
.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.upload-zone .up-icon {
  font-size: 32px;
  margin-bottom: 8px;
  transition: transform 0.3s;
}
.upload-zone:hover .up-icon { transform: scale(1.1) rotate(-5deg); }
.upload-zone h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 4px;
}
.upload-zone p { font-size: 13px; color: var(--gray); }
.upload-zone .up-limit {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray);
  margin-top: 8px;
  background: rgba(100,116,139,0.08);
  padding: 3px 10px;
  border-radius: 20px;
}

/* ── Portada preview ─────────────────────────────────────── */
.portada-preview {
  border-radius: 12px;
  overflow: hidden;
  height: 170px;
  position: relative;
  margin-top: 10px;
}
.portada-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.portada-preview .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.6));
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 14px;
  color: white;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.25s;
  cursor: pointer;
}
.portada-preview:hover .overlay { opacity: 1; }

/* ── Gallery preview grid ────────────────────────────────── */
.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.prev-item {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 1;
  border: 1.5px solid var(--border);
  animation: fadeInUp 0.3s ease-out;
}
.prev-item img { width: 100%; height: 100%; object-fit: cover; }
.prev-item button {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  background: rgba(0,0,0,0.65);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.prev-item button:hover { background: var(--red); }

/* ── Logo upload ─────────────────────────────────────────── */
.logo-upload {
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 1.25rem;
  cursor: pointer;
  transition: all 0.25s;
  position: relative;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: linear-gradient(180deg, var(--gray-lt) 0%, var(--white) 100%);
}
.logo-upload:hover {
  border-color: var(--blue);
  background: var(--blue-lt);
  border-style: solid;
}
.logo-upload input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.logo-placeholder {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background: var(--gray-lt);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
  overflow: hidden;
  transition: border-color 0.2s;
}
.logo-upload:hover .logo-placeholder { border-color: var(--blue); }
.logo-placeholder img { width: 100%; height: 100%; object-fit: cover; display: none; border-radius: 10px; }
.logo-text h4 { font-size: 14px; font-weight: 700; color: var(--dark); margin-bottom: 3px; }
.logo-text p { font-size: 13px; color: var(--gray); }

/* ── Toast notifications ─────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 68px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: calc(100% - 2rem);
  max-width: 420px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.08);
  animation: toastIn 0.35s cubic-bezier(0.4,0,0.2,1) forwards;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  transition: opacity 0.2s;
}
.toast:hover { opacity: 0.85; }
.toast.toast-out {
  animation: toastOut 0.3s cubic-bezier(0.4,0,0.2,1) forwards;
}
.toast-error {
  background: rgba(254,242,242,0.95);
  border: 1px solid #fecaca;
  color: #991b1b;
}
.toast-success {
  background: rgba(240,253,244,0.95);
  border: 1px solid #bbf7d0;
  color: #166534;
}
.toast-warning {
  background: rgba(255,251,235,0.95);
  border: 1px solid #fde68a;
  color: #92400e;
}
.toast-icon {
  font-size: 16px;
  flex-shrink: 0;
  line-height: 1;
}
.toast-text {
  flex: 1;
  line-height: 1.4;
}
.toast-close {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.06);
  color: inherit;
  font-size: 11px;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.15s, background 0.15s;
  padding: 0;
  line-height: 1;
}
.toast-close:hover {
  opacity: 1;
  background: rgba(0,0,0,0.1);
}

/* ── Inline field error highlight (no text, just border) ─── */
.field input.err,
.field textarea.err,
.field select.err {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(239,68,68,0.1);
}

/* ── Submit button ───────────────────────────────────────── */
.btn-submit {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, var(--blue) 0%, #3b82f6 100%);
  color: white;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 1.5rem;
  box-shadow: 0 4px 14px rgba(37,99,235,0.3);
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
}
.btn-submit::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.1) 100%);
  transition: opacity 0.3s;
  opacity: 0;
}
.btn-submit:hover::before { opacity: 1; }
.btn-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37,99,235,0.35);
}
.btn-submit:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(37,99,235,0.25);
}
.btn-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.submit-note {
  font-size: 12px;
  color: var(--gray);
  text-align: center;
  margin-top: 10px;
  line-height: 1.4;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: none;
}
.btn-submit.loading .spinner { display: block; }
.btn-submit.loading .btn-txt { display: none; }

/* ── Success screen ──────────────────────────────────────── */
.success-card {
  padding: 3rem 1.5rem;
  text-align: center;
}
.success-card .s-icon {
  font-size: 60px;
  margin-bottom: 1rem;
  animation: checkBounce 0.5s ease-out;
}
.success-card h2 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--dark);
  animation: fadeInUp 0.4s ease-out 0.2s both;
}
.success-card p {
  font-size: 14px;
  color: var(--gray);
  max-width: 360px;
  margin: 0 auto 1.5rem;
  line-height: 1.6;
  animation: fadeInUp 0.4s ease-out 0.3s both;
}
.success-card a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--blue) 0%, #3b82f6 100%);
  color: white;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(37,99,235,0.3);
  transition: all 0.2s;
  animation: fadeInUp 0.4s ease-out 0.4s both;
}
.success-card a:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37,99,235,0.35);
}

/* ── Confetti particles for success ──────────────────────── */
.confetti-wrap {
  position: relative;
  overflow: visible;
}
.confetti-wrap::before,
.confetti-wrap::after {
  content: '🎉';
  position: absolute;
  font-size: 24px;
  animation: confetti 1s ease-out forwards;
}
.confetti-wrap::before { left: 25%; top: 0; animation-delay: 0.1s; }
.confetti-wrap::after  { right: 25%; top: 0; animation-delay: 0.3s; content: '🎊'; }

/* ── Mobile optimizations ────────────────────────────────── */
@media (max-width: 520px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .logo-upload { flex-direction: column; text-align: center; }
  .card-body { padding: 1rem; }
  .card-head { padding: 0.75rem 1rem; }

  /* Larger touch targets on mobile */
  .field input,
  .field textarea,
  .field select {
    padding: 13px 14px;
    font-size: 16px; /* Prevents zoom on iOS */
  }
  .tag { padding: 10px 16px; font-size: 14px; }
  .btn-submit { padding: 16px; font-size: 17px; }
}

@media (max-width: 380px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
