/* ═══════════════════════════════════════════════════════════════
   ACES Cities Network — Components
   Botones, inputs, modales, stats pills, feature pills, etc.
═══════════════════════════════════════════════════════════════ */

/* ── AppPrimaryButton ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 100px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  border: none;
  transition: all 0.15s var(--ease);
  white-space: nowrap;
  user-select: none;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); opacity: 0.85; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; }

/* Primary — degradado azul→cian */
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--cyan) 100%);
  color: #fff;
  box-shadow: 0 4px 24px rgba(0, 207, 200, 0.18);
}
.btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 32px rgba(0, 207, 200, 0.32);
  transform: translateY(-1px);
}

/* Secondary — borde cian */
.btn-secondary {
  background: var(--cyan-dim);
  color: var(--cyan);
  border: 1px solid rgba(0,207,200,0.35);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--cyan);
  color: var(--bg);
  border-color: var(--cyan);
}

/* Ghost — borde suave */
.btn-ghost {
  background: rgba(255,255,255,0.06);
  color: var(--text-2);
  border: 1px solid var(--border);
}
.btn-ghost:hover:not(:disabled) {
  background: rgba(255,255,255,0.10);
  color: var(--text-1);
  border-color: rgba(255,255,255,0.20);
}

/* Danger */
.btn-danger {
  background: rgba(239,68,68,0.15);
  color: var(--danger);
  border: 1px solid rgba(239,68,68,0.30);
}
.btn-danger:hover:not(:disabled) {
  background: var(--danger);
  color: #fff;
}

/* Sizes */
.btn-sm { padding: 8px 16px; font-size: 13px; gap: 6px; }
.btn-lg { padding: 16px 28px; font-size: 16px; }
.btn-full { width: 100%; }

/* Icon button */
.btn-icon {
  width: 36px; height: 36px;
  padding: 0;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
}
.btn-icon:hover { background: rgba(255,255,255,0.10); color: var(--text-1); }
.btn-icon svg { width: 18px; height: 18px; }

/* Loading spinner en botón */
.btn-loading { position: relative; color: transparent !important; }
.btn-loading::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── AppTextInput ── */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.input-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.input-wrap svg.input-icon {
  position: absolute;
  left: 14px;
  width: 16px; height: 16px;
  color: var(--text-3);
  pointer-events: none;
  flex-shrink: 0;
}
.input-wrap .input-icon-right {
  position: absolute;
  right: 12px;
  width: 18px; height: 18px;
  color: var(--text-3);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.input-wrap .input-icon-right:hover { color: var(--text-2); }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="search"],
input[type="date"],
select,
textarea {
  width: 100%;
  background: var(--bg-field);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 400;
  color: var(--text-1);
  font-family: var(--font);
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}
input.has-icon { padding-left: 40px; }

input:focus, select:focus, textarea:focus {
  border-color: var(--cyan);
  background: rgba(15, 45, 90, 0.55);
  box-shadow: 0 0 0 3px rgba(0,207,200,0.08);
}
input::placeholder, textarea::placeholder { color: var(--text-3); }

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.42)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}
select option { background: #1a2744; color: var(--text-1); }

textarea { resize: vertical; min-height: 80px; line-height: 1.5; }

.input-error { border-color: var(--danger) !important; }
.input-error-msg { font-size: 12px; color: var(--danger); margin-top: 4px; }
.input-hint { font-size: 12px; color: var(--text-3); margin-top: 4px; }

/* ── Toggle / Checkbox ── */
.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.toggle-track {
  position: relative;
  width: 44px; height: 26px;
  background: rgba(255,255,255,0.15);
  border-radius: 13px;
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle-track input {
  position: absolute; opacity: 0; width: 0; height: 0;
}
.toggle-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s var(--ease);
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.toggle-track input:checked ~ .toggle-thumb { transform: translateX(18px); }
.toggle-track:has(input:checked) { background: var(--cyan); }
.toggle-label { font-size: 14px; color: var(--text-2); }

/* ── Progress bar ── */
.progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--cyan));
  border-radius: 2px;
  transition: width 0.4s var(--ease);
}

/* ── Stat pill (= statPill iOS) ── */
.stat-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 14px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  flex: 1;
  min-width: 0;
}
.stat-pill-num {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-1);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat-pill-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: center;
  line-height: 1.3;
}
.stat-pill-icon {
  display: flex; align-items: center; gap: 4px;
}
.stat-pill-icon svg { width: 11px; height: 11px; flex-shrink: 0; }
.stat-pills-row { display: flex; gap: 10px; }

/* ── Feature pill / Access grid cell ── */
.access-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s var(--ease);
  min-height: 100px;
}
.access-cell:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  text-decoration: none;
}
.access-cell:active { transform: scale(0.97); }
.access-cell-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.access-cell-icon svg { width: 20px; height: 20px; }
.access-cell h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.3;
  margin-top: auto;
}
.access-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ── Primary action button card ── */
.primary-action-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(10,110,250,0.2), rgba(0,207,200,0.1));
  border: 1px solid rgba(0,207,200,0.3);
  border-radius: var(--r-lg);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s var(--ease);
}
.primary-action-card:hover {
  border-color: rgba(0,207,200,0.55);
  box-shadow: 0 8px 32px rgba(0,207,200,0.12);
  transform: translateY(-1px);
  text-decoration: none;
}
.primary-action-card:active { transform: scale(0.98); }
.primary-action-icon {
  width: 44px; height: 44px;
  background: rgba(10,110,250,0.2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.primary-action-icon svg { width: 22px; height: 22px; color: var(--cyan); }
.primary-action-text h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-1);
}
.primary-action-text p {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 2px;
}
.primary-action-arrow {
  margin-left: auto;
  flex-shrink: 0;
  color: var(--cyan);
}
.primary-action-arrow svg { width: 16px; height: 16px; }

/* ── Candidatura card ── */
.candidatura-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s var(--ease);
}
.candidatura-card:hover {
  border-color: rgba(0,207,200,0.25);
  transform: translateY(-2px);
  text-decoration: none;
}
.candidatura-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.candidatura-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0; margin-top: 6px;
}
.candidatura-info { flex: 1; min-width: 0; }
.candidatura-name { font-size: 14px; font-weight: 700; color: var(--text-1); line-height: 1.3; }
.candidatura-sub  { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.candidatura-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.candidatura-meta-item {
  display: flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--text-3);
}
.candidatura-meta-item svg { width: 11px; height: 11px; }

/* ── Modal ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(6,13,28,0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--pad);
  animation: pageFade 0.15s ease both;
}
.modal {
  background: var(--bg-mid);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.modal-title { font-size: 18px; font-weight: 700; color: var(--text-1); }
.modal-footer { display: flex; gap: 10px; margin-top: 20px; }
.modal-footer .btn { flex: 1; }

/* ── Alert banner ── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid;
  font-size: 13px;
  line-height: 1.5;
}
.alert svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-error   { background: rgba(239,68,68,0.1);  border-color: rgba(239,68,68,0.3);  color: var(--text-1); }
.alert-error svg { color: var(--danger); }
.alert-success { background: rgba(34,197,122,0.1); border-color: rgba(34,197,122,0.3); color: var(--text-1); }
.alert-success svg { color: var(--success); }
.alert-info    { background: rgba(10,110,250,0.1); border-color: rgba(10,110,250,0.3); color: var(--text-1); }
.alert-info svg { color: var(--primary); }
.alert-warn    { background: rgba(245,158,11,0.1); border-color: rgba(245,158,11,0.3); color: var(--text-1); }
.alert-warn svg { color: var(--warning); }

/* ── Stepper (registro multi-paso) ── */
.stepper {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 28px;
}
.step-item {
  display: flex;
  align-items: center;
  flex: 1;
}
.step-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  flex-shrink: 0;
  transition: all 0.2s;
}
.step-dot.active   { background: var(--cyan); color: var(--bg); }
.step-dot.done     { background: var(--success); color: var(--bg); }
.step-dot.inactive { background: rgba(255,255,255,0.10); color: var(--text-3); border: 1px solid var(--border); }
.step-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 6px;
  transition: background 0.3s;
}
.step-line.done { background: var(--success); }
.step-line.active { background: linear-gradient(90deg, var(--success), var(--border)); }

/* ── List item ── */
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
  transition: opacity 0.15s;
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { opacity: 0.85; }
.list-item:active { opacity: 0.7; }
.list-item-icon {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.list-item-icon svg { width: 18px; height: 18px; }
.list-item-content { flex: 1; min-width: 0; }
.list-item-title { font-size: 14px; font-weight: 600; color: var(--text-1); }
.list-item-sub   { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.list-item-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.list-item-chevron { color: var(--text-3); }
.list-item-chevron svg { width: 14px; height: 14px; }

/* ── Avatar ── */
.avatar {
  border-radius: 50%;
  background: rgba(10,110,250,0.2);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-initials {
  font-size: 14px;
  font-weight: 700;
  color: var(--cyan);
  text-transform: uppercase;
}
.avatar-sm { width: 32px; height: 32px; }
.avatar-sm .avatar-initials { font-size: 12px; }
.avatar-md { width: 44px; height: 44px; }
.avatar-lg { width: 64px; height: 64px; }
.avatar-lg .avatar-initials { font-size: 22px; }
.avatar-xl { width: 84px; height: 84px; }
.avatar-xl .avatar-initials { font-size: 28px; }

/* ── Back button ── */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 500;
  color: var(--cyan);
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px 0;
  transition: opacity 0.15s;
}
.back-btn:hover { opacity: 0.75; }
.back-btn svg { width: 18px; height: 18px; }

/* ── Dot status indicator ── */
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.status-dot.draft     { background: var(--text-3); }
.status-dot.active    { background: var(--primary); }
.status-dot.evaluating { background: var(--warning); }
.status-dot.reviewing { background: var(--warning); }
.status-dot.decided   { background: var(--cyan); }
.status-dot.archived  { background: var(--text-3); }

/* ── Glow elements ── */
.glow-cyan {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,207,200,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.glow-blue {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(10,110,250,0.14) 0%, transparent 70%);
  pointer-events: none;
}

/* ── Tab selector ── */
.tab-bar {
  display: flex;
  gap: 0;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 3px;
}
.tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-3);
  cursor: pointer;
  background: none;
  border: none;
  transition: all 0.18s var(--ease);
  white-space: nowrap;
}
.tab-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.tab-btn.active {
  background: var(--bg-mid);
  color: var(--cyan);
  border: 1px solid var(--border);
}
.tab-btn:hover:not(.active) { color: var(--text-2); }

/* ── Hero gradient header ── */
.hero-header {
  position: relative;
  overflow: hidden;
  padding: 24px var(--pad);
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 100%);
}
.hero-header::before {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(0,207,200,0.10) 0%, transparent 70%);
  top: -80px; right: -80px;
  pointer-events: none;
}
.hero-header::after {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(10,110,250,0.12) 0%, transparent 70%);
  bottom: -60px; left: -60px;
  pointer-events: none;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 100px;
  background: var(--cyan-dim);
  border: 1px solid rgba(0,207,200,0.3);
  font-size: 11px;
  font-weight: 700;
  color: var(--cyan);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.hero-badge-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--cyan);
}
.hero-accent-line {
  width: 44px; height: 2px;
  background: linear-gradient(90deg, var(--cyan), var(--primary));
  border-radius: 1px;
  margin-top: 12px;
}

/* ── Info box (note) ── */
.info-box {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  background: var(--cyan-dim);
  border: 1px solid rgba(0,207,200,0.2);
  border-radius: var(--r-md);
}
.info-box svg { width: 16px; height: 16px; color: var(--cyan); flex-shrink: 0; margin-top: 1px; }
.info-box p { font-size: 13px; color: var(--text-2); line-height: 1.5; }

/* ── Scroll fade mask ── */
.scroll-fade-bottom {
  -webkit-mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
}

/* ── Pulse animation ── */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.8); }
}
.pulse { animation: pulse-dot 2s ease-in-out infinite; }

/* ── Notification badge in nav items ── */
.nav-notif-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--danger);
  color: white;
  font-size: 9px;
  font-weight: 700;
  border-radius: 100px;
  padding: 1px 4px;
  min-width: 14px;
  text-align: center;
  line-height: 1.4;
}

/* ── Auth language button ── */
#auth-lang-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 100;
  background: rgba(13,30,58,0.85);
  border: 1px solid rgba(168,184,216,0.15);
  border-radius: 8px;
  padding: 6px 12px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.15s;
}

#auth-lang-btn:hover {
  background: rgba(13,30,58,0.95);
  color: var(--text-1);
}
