/* ════════════════════════════════════════════════════════════════════════════
   Vélo · Components
   Buttons, cards, glass, badges, forms, avatar, modal, dropdown, tabs, etc.
   ════════════════════════════════════════════════════════════════════════════ */

/* ══ Buttons ════════════════════════════════════════════════════════════ */
.btn {
  --btn-bg: var(--accent);
  --btn-fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--radius-pill);
  font-weight: 600; font-size: .95rem;
  background: var(--btn-bg); color: var(--btn-fg);
  transition: transform var(--t-spring), box-shadow var(--t), background var(--t);
  white-space: nowrap; user-select: none;
  position: relative; overflow: hidden;
}
.btn i { font-size: .95em; }
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: scale(.96); }
.btn:disabled, .btn.disabled { opacity: .5; pointer-events: none; }

.btn-primary  { background: var(--accent); color: #fff; box-shadow: 0 6px 18px var(--accent-soft); }
.btn-primary:hover { background: var(--accent-h); box-shadow: 0 10px 24px var(--accent-soft); }

.btn-dark     { background: var(--brand); color: #fff; }
.btn-dark:hover { background: var(--brand-2); }

.btn-outline  {
  background: transparent; border: 1.5px solid var(--border-2); color: var(--text);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.btn-ghost    { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-2); color: var(--text); }

.btn-danger   { background: var(--danger); color: #fff; }
.btn-success  { background: var(--success); color: #fff; }
.btn-gold     { background: var(--gold); color: var(--brand); }

.btn-glass {
  background: var(--glass-bg); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border); color: var(--text);
  box-shadow: var(--shadow-sm);
}

.btn-google {
  background: #fff; color: #1F1F1F;
  border: 1.5px solid #E5E7EB;
  font-weight: 600; width: 100%;
  padding: 14px 24px;
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius-pill);
}
.btn-google:hover { border-color: #4285F4; box-shadow: var(--shadow); }

.btn-sm  { padding: 8px 16px; font-size: .85rem; }
.btn-lg  { padding: 16px 28px; font-size: 1rem; }
.btn-full { width: 100%; }

.btn-icon {
  width: 40px; height: 40px; padding: 0;
  border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center;
}
.btn-icon.btn-sm { width: 34px; height: 34px; }
.btn-icon.btn-lg { width: 52px; height: 52px; font-size: 1.2rem; }

/* ══ Cards ══════════════════════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-hairline);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t), box-shadow var(--t);
}
.card.card-interactive:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; gap: 12px;
}
.card-title {
  font-size: 1rem; font-weight: 700;
  display: inline-flex; align-items: center; gap: 8px;
}
.card-title i { color: var(--accent); }
.card-subtitle { font-size: .8rem; color: var(--muted); margin-top: 2px; }

/* Card con estilo glass (iOS) */
.card-glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  position: relative;
}
.card-glass::before {
  content: ''; position: absolute; inset: 0;
  border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.12), transparent 40%);
  mix-blend-mode: overlay;
}

/* Card degradado marca */
.card-brand {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: var(--on-brand);
  border-radius: var(--radius-lg);
  padding: 22px;
  position: relative; overflow: hidden;
  border: 1px solid rgba(255,255,255,.05);
}
.card-brand::after {
  content: ''; position: absolute;
  top: -40%; right: -20%; width: 280px; height: 280px;
  background: radial-gradient(circle, var(--accent-soft), transparent 70%);
  pointer-events: none;
}
.card-brand h3, .card-brand .card-title { color: #fff; }

/* ══ Badges ═════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 11px; border-radius: var(--radius-pill);
  font-size: .72rem; font-weight: 700; letter-spacing: .02em;
  text-transform: uppercase;
}
.badge i { font-size: .72rem; }
.badge-pending  { background: var(--warning-soft); color: var(--warning); }
.badge-approved { background: var(--success-soft); color: var(--success); }
.badge-rejected { background: var(--danger-soft);  color: var(--danger); }
.badge-admin    { background: var(--info-soft);    color: var(--info); }
.badge-super    { background: var(--gold-soft);    color: var(--gold); }
.badge-neutral  { background: var(--bg-2);         color: var(--text-2); }

/* ══ Forms ══════════════════════════════════════════════════════════════ */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-size: .85rem; font-weight: 600; color: var(--text-2);
  display: inline-flex; align-items: center; gap: 6px;
}
.form-label span { color: var(--danger); margin-left: 2px; }

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  transition: border-color var(--t), box-shadow var(--t), background var(--t);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--muted-2); }
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--ring);
}
.form-input.error { border-color: var(--danger); }
.form-textarea { resize: vertical; min-height: 90px; }

.form-hint  { font-size: .75rem; color: var(--muted); }
.form-error { font-size: .75rem; color: var(--danger); display: none; }
.form-error.show { display: block; }

/* Input con icono */
.input-icon { position: relative; }
.input-icon > i {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--muted-2); pointer-events: none;
}
.input-icon input { padding-left: 42px; }

/* Combobox */
.combobox { position: relative; }
.combobox-input {
  width: 100%; padding: 13px 40px 13px 16px;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  font-size: 1rem; cursor: pointer; background: var(--surface);
  color: var(--text);
  transition: border-color var(--t), box-shadow var(--t);
}
.combobox-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring); }
.combobox-arrow {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  pointer-events: none; color: var(--muted);
}
.combobox-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  max-height: 240px; overflow-y: auto; z-index: 100;
  display: none; padding: 6px;
}
.combobox-dropdown.open { display: block; animation: fadeIn .18s var(--ease); }
.combobox-option {
  padding: 10px 14px; cursor: pointer; font-size: .92rem;
  border-radius: var(--radius-sm);
  transition: background var(--t-fast);
}
.combobox-option:hover, .combobox-option.active { background: var(--bg-2); }
.combobox-option mark { background: none; color: var(--accent); font-weight: 700; }
.combobox-empty { padding: 12px 14px; color: var(--muted); font-size: .875rem; }

/* ══ Avatar ═════════════════════════════════════════════════════════════ */
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .95rem; color: #fff;
  flex-shrink: 0; overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,.12);
  position: relative;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-sm  { width: 32px; height: 32px; font-size: .8rem; }
.avatar-lg  { width: 56px; height: 56px; font-size: 1.2rem; }
.avatar-xl  { width: 96px; height: 96px; font-size: 2rem; }
.avatar-ring {
  box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--accent);
}

/* ══ Dropdown ═══════════════════════════════════════════════════════════ */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 220px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 200;
  opacity: 0; transform: translateY(-6px) scale(.96);
  transform-origin: top right;
  pointer-events: none;
  transition: opacity var(--t), transform var(--t-spring);
}
.dropdown.open .dropdown-menu {
  opacity: 1; transform: translateY(0) scale(1);
  pointer-events: auto;
}
/* Dropdown que se abre hacia arriba (útil en FAB flotante) */
.dropdown-menu.dropdown-up {
  top: auto; bottom: calc(100% + 10px);
  transform: translateY(6px) scale(.96);
  transform-origin: bottom right;
}
.dropdown.open .dropdown-menu.dropdown-up {
  transform: translateY(0) scale(1);
}
.dropdown-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: .9rem; font-weight: 500;
  cursor: pointer;
  transition: background var(--t-fast);
  text-decoration: none;
  width: 100%;
  background: none; border: none;
  text-align: left;
}
.dropdown-item i { color: var(--muted); width: 16px; text-align: center; }
.dropdown-item:hover { background: var(--bg-2); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger i { color: var(--danger); }
.dropdown-divider { height: 1px; background: var(--glass-hairline); margin: 6px 2px; }
.dropdown-header {
  padding: 10px 12px 6px; font-size: .7rem; color: var(--muted);
  font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
}

/* ══ Progress bar ═══════════════════════════════════════════════════════ */
.progress-wrap {
  background: var(--border); border-radius: var(--radius-pill);
  height: 10px; overflow: hidden;
}
.progress-bar {
  height: 100%; border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--accent), var(--gold));
  transition: width .8s var(--ease);
  position: relative;
}
.progress-bar::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.3), transparent);
  animation: progressShine 2.4s linear infinite;
}
@keyframes progressShine { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* ══ Modal (bottom sheet mobile, centered desktop) ══════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 300; display: flex; align-items: flex-end;
  opacity: 0; pointer-events: none;
  transition: opacity var(--t);
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 8px 20px 28px; width: 100%;
  transform: translateY(100%);
  transition: transform var(--t-spring);
  max-height: 92dvh; overflow-y: auto;
  border: 1px solid var(--glass-hairline);
  border-bottom: none;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-handle {
  width: 44px; height: 5px;
  background: var(--border-2);
  border-radius: 3px; margin: 10px auto 16px;
}
.modal-title {
  font-size: 1.1rem; font-weight: 700; margin-bottom: 18px;
  display: flex; align-items: center; gap: 10px;
}
.modal-title i { color: var(--accent); }

@media (min-width: 768px) {
  .modal-overlay { align-items: center; padding: 24px; }
  .modal {
    border-radius: var(--radius-xl);
    max-width: 520px; margin: 0 auto;
    transform: translateY(20px) scale(.96);
    border: 1px solid var(--glass-hairline);
  }
  .modal-overlay.open .modal { transform: translateY(0) scale(1); }
  .modal-handle { display: none; }
}

/* ══ Tabs (pills segmentadas) ═══════════════════════════════════════════ */
.tabs {
  display: flex; gap: 4px;
  background: var(--bg-2);
  border-radius: var(--radius-pill); padding: 4px;
  overflow: hidden;
}
.tab {
  flex: 1; padding: 9px 10px; font-size: .85rem; font-weight: 600;
  border-radius: var(--radius-pill); cursor: pointer; text-align: center;
  color: var(--muted); transition: all var(--t);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  white-space: nowrap;
}
.tab i { font-size: .85rem; }
.tab.active {
  background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-xs);
}

/* ══ File upload ════════════════════════════════════════════════════════ */
.file-drop {
  border: 1.5px dashed var(--border-2); border-radius: var(--radius-lg);
  padding: 28px 20px; text-align: center; cursor: pointer;
  transition: all var(--t); background: var(--bg);
}
.file-drop:hover, .file-drop.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.file-drop input[type="file"] { display: none; }
.file-drop i { font-size: 1.5rem; color: var(--muted); margin-bottom: 6px; display: block; }

/* ══ Photo preview ══════════════════════════════════════════════════════ */
.photo-preview {
  width: 100%; aspect-ratio: 4/3; border-radius: var(--radius-lg);
  object-fit: cover; background: var(--bg-2);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }

/* ══ Empty state ════════════════════════════════════════════════════════ */
.empty-state {
  text-align: center; padding: 48px 20px; color: var(--muted);
}
.empty-state-icon {
  font-size: 2.5rem; margin-bottom: 14px; color: var(--muted-2);
  display: inline-flex; width: 72px; height: 72px;
  border-radius: 50%; background: var(--bg-2);
  align-items: center; justify-content: center;
}
.empty-state h3   { font-size: 1.05rem; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.empty-state p    { font-size: .9rem; max-width: 320px; margin: 0 auto; }

/* ══ Stat card ══════════════════════════════════════════════════════════ */
.stat-card {
  background: var(--surface); border-radius: var(--radius-lg);
  border: 1px solid var(--glass-hairline); padding: 16px;
  display: flex; flex-direction: column; gap: 4px;
  position: relative; overflow: hidden;
  transition: transform var(--t), box-shadow var(--t);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card .stat-icon {
  position: absolute; top: 14px; right: 14px;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1rem;
}
.stat-value {
  font-size: 2rem; font-weight: 800;
  font-family: var(--font-display); line-height: 1; color: var(--text);
}
.stat-label {
  font-size: .72rem; color: var(--muted);
  font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
}

/* ══ List item ══════════════════════════════════════════════════════════ */
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--glass-hairline);
}
.list-item:last-child { border-bottom: none; }

/* ══ Switch (toggle) ════════════════════════════════════════════════════ */
.switch {
  position: relative; display: inline-block;
  width: 44px; height: 24px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute; inset: 0; cursor: pointer;
  background: var(--border-2); border-radius: 24px;
  transition: background var(--t);
}
.switch-slider::before {
  content: ''; position: absolute;
  width: 18px; height: 18px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%;
  transition: transform var(--t-spring);
  box-shadow: var(--shadow-sm);
}
.switch input:checked + .switch-slider { background: var(--accent); }
.switch input:checked + .switch-slider::before { transform: translateX(20px); }

/* ══ Divider ════════════════════════════════════════════════════════════ */
.divider {
  height: 1px; background: var(--glass-hairline); margin: 16px 0;
}
.divider-text {
  display: flex; align-items: center; gap: 12px; color: var(--muted);
  font-size: .8rem; margin: 16px 0;
}
.divider-text::before, .divider-text::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ══ Chip ═══════════════════════════════════════════════════════════════ */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--radius-pill);
  background: var(--bg-2); color: var(--text-2);
  font-size: .8rem; font-weight: 600;
}
.chip i { color: var(--muted); }
