/* ─────────────────────────────────────────────
   components.css — Reusable UI components
───────────────────────────────────────────── */

/* ── Buttons ─────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--sp-2); border: none; border-radius: var(--r-sm);
  font-family: var(--font-sans); font-weight: 500; cursor: pointer;
  transition: transform var(--dur-fast) var(--ease),
              box-shadow var(--dur-normal) var(--ease),
              opacity var(--dur-fast);
  white-space: nowrap; user-select: none;
}
.btn:active { transform: scale(.95); }
.btn:disabled { opacity: .4; pointer-events: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--clr-gold), var(--clr-gold2));
  color: #080808; font-size: 14px; padding: 14px 24px;
  letter-spacing: .04em;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px #c9a96e35;
}
.btn-primary.lg { padding: 16px 32px; font-size: 15px; }
.btn-primary.sm { padding: 9px 18px; font-size: 12px; }
.btn-primary.full { width: 100%; }

.btn-ghost {
  background: transparent; border: 1px solid var(--clr-border2);
  color: var(--clr-muted); font-size: 13px; padding: 12px 24px;
}
.btn-ghost:hover { border-color: #383838; color: var(--clr-white); }
.btn-ghost.full { width: 100%; }

.btn-icon {
  background: var(--clr-surface2); border: 1px solid var(--clr-border);
  border-radius: 50%; width: 38px; height: 38px;
  color: var(--clr-muted); font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color var(--dur-fast), color var(--dur-fast);
  position: relative;
}
.btn-icon:hover { border-color: var(--clr-border2); color: var(--clr-white); }

.btn-danger {
  background: #2d1010; border: 1px solid #5a2020;
  color: var(--clr-danger); font-size: 13px; padding: 10px 20px;
  border-radius: var(--r-sm);
}

/* ── Inputs ──────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--clr-muted);
}
.input-wrap { position: relative; }
.input-wrap .icon {
  position: absolute; right: 14px; top: 50%;
  transform: translateY(-50%); color: var(--clr-muted);
  font-size: 14px; pointer-events: none;
}
.input-wrap .icon.clickable { pointer-events: all; cursor: pointer; }

.input, .select, .textarea {
  width: 100%; background: var(--clr-surface);
  border: 1px solid var(--clr-border); border-radius: var(--r-sm);
  color: var(--clr-white); font-family: var(--font-sans); font-size: 14px;
  padding: 13px 44px 13px 16px; outline: none;
  transition: border-color var(--dur-normal) var(--ease),
              box-shadow var(--dur-normal) var(--ease);
  -webkit-appearance: none; appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--clr-muted2); }
.input:focus, .select:focus, .textarea:focus {
  border-color: #c9a96e50;
  box-shadow: 0 0 0 3px #c9a96e10;
}
.input.error { border-color: #5a2020; box-shadow: 0 0 0 3px #f8717110; }
.textarea { resize: none; padding: 13px 16px; }
.select { cursor: pointer; }
.select option { background: var(--clr-surface2); }

/* ── Cards ───────────────────── */
.card {
  background: var(--clr-surface); border: 1px solid var(--clr-border);
  border-radius: var(--r-md); overflow: hidden;
  transition: transform var(--dur-normal) var(--ease),
              border-color var(--dur-normal) var(--ease);
}
.card:hover { transform: translateY(-2px); border-color: var(--clr-border2); }
.card.gold-hover:hover { border-color: #c9a96e30; }

/* ── Avatar ──────────────────── */
.avatar {
  border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-weight: 600; flex-shrink: 0;
  background: linear-gradient(135deg, var(--clr-gold), #7b5c2e);
  color: #080808; font-size: 14px;
  transition: transform var(--dur-fast), border-color var(--dur-fast);
}
.avatar.sm { width: 32px; height: 32px; font-size: 11px; }
.avatar.md { width: 44px; height: 44px; font-size: 15px; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.avatar.xl { width: 88px; height: 88px; font-size: 30px; }

/* ── Badge / Tag ─────────────── */
.badge {
  display: inline-flex; align-items: center;
  font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 20px; font-weight: 500;
}
.badge-gold  { background: #c9a96e18; color: var(--clr-gold); border: 1px solid #c9a96e30; }
.badge-green { background: #4ade8018; color: var(--clr-success); border: 1px solid #4ade8030; }
.badge-red   { background: #f8717118; color: var(--clr-danger);  border: 1px solid #f8717130; }
.badge-blue  { background: #60a5fa18; color: var(--clr-info);   border: 1px solid #60a5fa30; }
.badge-muted { background: #1e1e1e; color: var(--clr-muted); border: 1px solid var(--clr-border); }

/* ── Divider ─────────────────── */
.divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--clr-muted); font-size: 11px;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px; background: var(--clr-border);
}

/* ── Section Header ──────────── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--sp-4);
}
.section-header h3 { font-size: 15px; font-weight: 500; }
.section-header a  { font-size: 12px; color: var(--clr-gold); }

/* ── Toast ───────────────────── */
#toast-container {
  position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%);
  z-index: var(--z-toast); display: flex; flex-direction: column;
  align-items: center; gap: var(--sp-2); pointer-events: none;
}
.toast {
  background: var(--clr-surface3); border: 1px solid var(--clr-border2);
  border-radius: var(--r-md); padding: 12px 20px;
  font-size: 13px; color: var(--clr-white);
  box-shadow: 0 8px 24px #00000060;
  display: flex; align-items: center; gap: var(--sp-3);
  transform: translateY(10px); opacity: 0;
  transition: transform var(--dur-normal) var(--ease),
              opacity var(--dur-normal) var(--ease);
  max-width: 320px; text-align: center;
}
.toast.show    { transform: translateY(0); opacity: 1; }
.toast.success { border-color: #4ade8040; }
.toast.error   { border-color: #f8717140; }
.toast-icon    { font-size: 16px; }

/* ── Modal ───────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: #000000b0;
  backdrop-filter: blur(6px); z-index: var(--z-modal);
  opacity: 0; pointer-events: none;
  transition: opacity var(--dur-normal) var(--ease);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: var(--clr-surface2); border-top: 1px solid var(--clr-border);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  transform: translateY(100%);
  transition: transform var(--dur-slow) var(--ease);
  max-height: 85vh; overflow-y: auto;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-handle {
  width: 36px; height: 3px; background: var(--clr-border2);
  border-radius: 2px; margin: 12px auto 0;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-5) var(--sp-6) var(--sp-4);
}
.modal-header h3 { font-size: 17px; font-weight: 500; }
.modal-body { padding: 0 var(--sp-6) var(--sp-10); }

/* ── Bottom Nav ──────────────── */
.bottom-nav {
  display: flex; position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(8,8,8,.94); border-top: 1px solid var(--clr-border);
  padding: 10px 0 28px; z-index: var(--z-nav);
  backdrop-filter: blur(24px);
}
.nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: 4px; background: transparent; border: none;
  color: var(--clr-muted); font-family: var(--font-sans); font-size: 9px;
  letter-spacing: .06em; text-transform: uppercase;
  cursor: pointer; padding: 4px; transition: color var(--dur-fast);
}
.nav-item.active { color: var(--clr-gold); }
.nav-item svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.5; }
.nav-badge {
  position: absolute; top: 2px; right: 8px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--clr-gold); border: 2px solid var(--clr-bg);
}

/* ── Loader / Skeleton ───────── */
.skeleton {
  background: linear-gradient(90deg, var(--clr-surface2) 25%, var(--clr-surface3) 50%, var(--clr-surface2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--r-sm);
}
@keyframes shimmer { to { background-position: -200% 0; } }

.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--clr-border2);
  border-top-color: var(--clr-gold);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Progress bar ────────────── */
.progress-bar {
  height: 1px; background: var(--clr-border); border-radius: 1px; overflow: hidden;
}
.progress-fill {
  height: 100%; background: linear-gradient(90deg, var(--clr-gold), var(--clr-gold2));
  border-radius: 1px; width: 0;
  transition: width var(--dur-normal) var(--ease);
}

/* ── Input shake animation ───── */
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}
.shake { animation: shake 320ms ease-in-out; }

/* ── Gold diamond logo mark ───── */
.logo-mark {
  display: flex; align-items: center; gap: var(--sp-2);
}
.logo-mark .diamond { color: var(--clr-gold); font-size: 14px; }
.logo-mark .wordmark {
  font-family: var(--font-serif); font-size: 20px;
  font-weight: 300; letter-spacing: .22em;
}
