/* =========================
   Button rows
   ========================= */

.btn-row{
  display:flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

@media (max-width: 760px){
  .btn-row{
    flex-direction:column;
  }
}

/* =========================
   Base button
   ========================= */

.btn{
  appearance:none;
  border:none;
  cursor:pointer;
  border-radius: 12px;
  font-weight: 750;
  padding: 12px 16px;
  min-height: var(--tap);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  user-select:none;

  position: relative;
  overflow: hidden; /* ripple stays inside button radius */

  transition:
    transform 120ms ease,
    box-shadow 160ms ease,
    filter 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    opacity 160ms ease;

  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* =========================
   Button variants
   ========================= */

.btn.primary{
  background: linear-gradient(180deg, var(--brand), var(--brand-600));
  color: #071028;
  box-shadow: 0 8px 22px var(--shadow);
}

.btn.secondary{
  background: transparent;
  border: 1px solid rgba(255,255,255,0.10);
  color: var(--ink);
  box-shadow:none;
}

/* =========================
   Focus (keyboard accessible)
   ========================= */

.btn:focus-visible{
  outline: none;
  box-shadow:
    0 0 0 3px rgba(33,188,165,0.35),
    0 0 0 1px rgba(255,255,255,0.14) inset,
    0 10px 24px rgba(20,59,54,0.35);
}

/* =========================
   Hover (desktop only)
   ========================= */

@media (hover:hover) and (pointer:fine){
  .btn:hover{
    transform: translateY(-1px);
    filter: brightness(1.05);
  }

  .btn.secondary:hover{
    border-color: rgba(255,255,255,0.22);
    background: rgba(255, 255, 255, 0.188);
    box-shadow: 0 10px 22px rgba(0,0,0,0.22);
  }

  .btn.primary:hover{
    box-shadow:
      0 14px 30px rgba(20,59,54,0.45),
      0 0 0 1px rgba(255,255,255,0.08) inset;
  }
}

/* =========================
   Active / press states
   ========================= */

.btn:active{
  transform: translateY(0px) scale(0.985);
  filter: brightness(0.98);
}

.btn.primary:active{
  box-shadow:
    0 6px 14px rgba(20,59,54,0.35),
    inset 0 2px 0 rgba(0,0,0,0.10);
}

.btn.secondary:active{
  background: rgba(255,255,255,0.035);
  border-color: rgba(255,255,255,0.18);
  box-shadow: inset 0 2px 0 rgba(0,0,0,0.10);
}

/* =========================
   Disabled state
   ========================= */

.btn:disabled,
.btn[aria-disabled="true"]{
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  filter: none;
  box-shadow: none;
  pointer-events: none;
}

/* Optional loading state */
.btn.is-busy{
  cursor: progress;
  opacity: 0.75;
}

/* =========================
   Ripple / press glow
   ========================= */

.btn::after{
  content:"";
  position:absolute;
  inset:-2px;
  background: radial-gradient(
    circle at var(--rx, 50%) var(--ry, 50%),
    rgba(255,255,255,0.28) 0%,
    rgba(255,255,255,0.10) 18%,
    transparent 45%
  );
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events:none;
}

.btn:active::after{
  opacity: 1;
}