/* ===========================================================
   SPHERE SAVE
   Reuses tokens/shell from dashboard.css (--cs-*, .cs-app,
   .cs-shell, .cs-frame, .cs-main, .cs-section, .cs-tx-*, etc).
   Load dashboard.css on this page. Everything below — including
   the transact-toggle / field / warning-banner / category-pill
   classes — is self-contained here for now since there's no
   shared transact.css yet; move those blocks there once a
   dedicated transact page exists, so they aren't duplicated.
   =========================================================== */

/* ---------- hero ---------- */

.cs-save-hero {
  position: relative;
  border-radius: var(--cs-radius-lg);
  overflow: hidden;
  min-height: 270px;
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px;
  color: var(--cs-white);
  box-shadow: var(--cs-shadow-card);
}

.cs-save-hero-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 4px;
}

.cs-save-hero-title {
  margin: 0;
  font-family: var(--cs-font-display);
  font-weight: 800;
  font-size: 24px;
  line-height: 1.15;
}

.cs-save-hero-subtitle {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.85);
}

/* ---------- explainer ---------- */

.cs-save-explainer {
  background: var(--cs-cloud-100);
  border: 1px solid var(--cs-cloud-200);
  border-radius: var(--cs-radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cs-save-explainer-title {
  margin: 0;
  font-family: var(--cs-font-display);
  font-weight: 700;
  font-size: 15.5px;
  color: var(--cs-ink-950);
}

.cs-save-explainer-lead {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--cs-slate-600);
}

.cs-save-explainer-points {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cs-save-explainer-point {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--cs-ink-950);
}

.cs-save-explainer-point-icon {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--cs-white);
  color: var(--cs-brand-700);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

/* ===========================================================
   BALANCE SUMMARY — full-bleed premium tiles, not a white card
   with a thin accent line. Each tone owns the whole card: a
   saturated gradient, a faint diagonal hairline texture, a soft
   top-right highlight, and a shadow tinted to match — the same
   "vivid tile" language the dashboard's wallet cards use, so
   Sphere Save reads as part of the same premium product instead
   of a lighter, unfinished corner of it.
   =========================================================== */

.cs-save-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.cs-save-summary-card {
  position: relative;
  overflow: hidden;
  border: none;
  border-radius: var(--cs-radius-lg);
  padding: 16px 16px 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  color: var(--cs-white);
  background-image:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0px, rgba(255, 255, 255, 0.06) 2px, transparent 2px, transparent 10px),
    radial-gradient(circle at 88% -10%, rgba(255, 255, 255, 0.3), transparent 55%);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.cs-save-summary-card:hover {
  transform: translateY(-2px);
}

.cs-save-summary-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cs-save-summary-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.2);
  color: var(--cs-white);
}

.cs-save-summary-eye-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.16);
  color: var(--cs-white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
}

.cs-save-summary-eye-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

.cs-save-summary-label {
  position: relative;
  z-index: 1;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.85);
}

.cs-save-summary-value-wrap {
  position: relative;
  z-index: 1;
  overflow: hidden;
  border-radius: 8px;
}

.cs-save-summary-value {
  display: block;
  font-family: var(--cs-font-display);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.01em;
  color: var(--cs-white);
  font-variant-numeric: tabular-nums;
}

/* Hidden by default: NOT text replaced with asterisks — a real
   frosted-glass layer sitting on top of the actual value, using
   backdrop-filter to blur whatever renders behind it. The number
   stays in the DOM the whole time; only its visibility toggles. */

.cs-save-summary-blur-overlay {
  display: none;
}

.cs-save-summary-card--blurred .cs-save-summary-blur-overlay {
  display: block;
  position: absolute;
  inset: -6px -8px;
  backdrop-filter: blur(7px) saturate(140%);
  -webkit-backdrop-filter: blur(7px) saturate(140%);
  background: rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}

/* tone: available — neutral ink/navy, "ready to spend right now" */

.cs-save-summary-card[data-tone="available"] {
  background-color: var(--cs-ink-950);
  background-image:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0px, rgba(255, 255, 255, 0.05) 2px, transparent 2px, transparent 10px),
    linear-gradient(155deg, var(--cs-slate-600), var(--cs-ink-950) 65%);
  box-shadow: 0 14px 26px -14px rgba(6, 24, 58, 0.6);
}

/* tone: flexible — full brand blue, Sphere Savings Account */

.cs-save-summary-card[data-tone="flexible"] {
  background-color: var(--cs-brand-700);
  background-image:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.07) 0px, rgba(255, 255, 255, 0.07) 2px, transparent 2px, transparent 10px),
    linear-gradient(155deg, var(--cs-brand-500), var(--cs-brand-800) 65%);
  box-shadow: 0 14px 26px -14px rgba(16, 73, 163, 0.55);
}

/* tone: lock — gold/amber "vault" accent, deliberately distinct
   from flexible so the two Sphere products read as visually
   different products at a glance, not just differently labeled */

.cs-save-summary-card[data-tone="lock"] {
  background-color: var(--cs-gold-400);
  background-image:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0px, rgba(255, 255, 255, 0.08) 2px, transparent 2px, transparent 10px),
    linear-gradient(155deg, #f5bf62, var(--cs-gold-400) 45%, #96600e 100%);
  box-shadow: 0 14px 26px -14px rgba(184, 115, 10, 0.55);
}

/* ===========================================================
   MODE TOGGLE — segmented control switching between Sphere
   Savings Account and Sphere Lock Savings
   =========================================================== */

.cs-transact-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: var(--cs-cloud-100);
  border: 1px solid var(--cs-cloud-200);
  border-radius: var(--cs-radius-pill);
  padding: 4px;
}

.cs-transact-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: none;
  background: transparent;
  color: var(--cs-slate-600);
  font-family: var(--cs-font-display);
  font-weight: 700;
  font-size: 12.5px;
  padding: 11px 10px;
  border-radius: var(--cs-radius-pill);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.cs-transact-toggle-btn svg {
  width: 16px;
  height: 16px;
}

.cs-transact-toggle-btn.is-active {
  background: var(--cs-white);
  color: var(--cs-brand-700);
  box-shadow: 0 4px 12px rgba(11, 31, 59, 0.12);
}

/* ===========================================================
   FORM CARD
   =========================================================== */

.cs-transact-card {
  background: var(--cs-white);
  border: 1px solid var(--cs-cloud-200);
  border-radius: var(--cs-radius-lg);
  padding: 18px;
  box-shadow: var(--cs-shadow-card);
}

.cs-transact-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.cs-field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cs-field-group--hidden {
  display: none;
}

.cs-field-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--cs-ink-950);
}

.cs-field-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--cs-cloud-50);
  border: 1px solid var(--cs-cloud-200);
  border-radius: var(--cs-radius-sm);
  padding: 0 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cs-field-input-wrap:focus-within {
  border-color: var(--cs-brand-500);
  box-shadow: 0 0 0 3px rgba(47, 116, 230, 0.14);
}

.cs-field-icon {
  flex: none;
  display: flex;
  color: var(--cs-slate-400);
}

.cs-field-icon svg {
  width: 16px;
  height: 16px;
}

.cs-field-prefix {
  flex: none;
  font-family: var(--cs-font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--cs-slate-600);
}

.cs-field-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  outline: none;
  padding: 13px 0;
  font-size: 14px;
  font-family: var(--cs-font-body);
  color: var(--cs-ink-950);
}

.cs-field-input:disabled {
  color: var(--cs-slate-600);
  -webkit-text-fill-color: var(--cs-slate-600);
  opacity: 1;
}

.cs-field-input::placeholder {
  color: var(--cs-slate-400);
}

.cs-field-hint {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--cs-slate-400);
}

/* ---------- lock-duration pills ---------- */

.cs-category-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.cs-category-scroll::-webkit-scrollbar {
  display: none;
}

.cs-category-pill {
  flex: none;
  white-space: nowrap;
  border: 1px solid var(--cs-cloud-200);
  background: var(--cs-white);
  color: var(--cs-slate-600);
  font-size: 12.5px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: var(--cs-radius-pill);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.cs-category-pill.is-active {
  background: var(--cs-gold-400);
  border-color: var(--cs-gold-400);
  color: var(--cs-white);
}

/* ---------- warning banner ---------- */

.cs-warning-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(240, 169, 59, 0.12);
  border: 1px solid rgba(240, 169, 59, 0.35);
  border-radius: var(--cs-radius-sm);
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.55;
  color: #8a5a0a;
}

.cs-warning-icon {
  flex: none;
  display: flex;
  color: #b8730a;
  margin-top: 1px;
}

.cs-warning-icon svg {
  width: 16px;
  height: 16px;
}

/* ---------- deposit / withdraw buttons ---------- */

.cs-save-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.cs-save-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  background: linear-gradient(135deg, var(--cs-brand-600), var(--cs-brand-800));
  color: var(--cs-white);
  font-family: var(--cs-font-display);
  font-weight: 700;
  font-size: 13px;
  padding: 13px 12px;
  border-radius: var(--cs-radius-pill);
  cursor: pointer;
  text-align: center;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.cs-save-action-btn svg {
  width: 17px;
  height: 17px;
}

.cs-save-action-btn:hover {
  transform: translateY(-1px);
}

.cs-save-action-btn--secondary {
  background: var(--cs-white);
  border: 1px solid var(--cs-brand-600);
  color: var(--cs-brand-700);
}

.cs-save-action-btn:disabled,
.cs-save-action-btn.is-loading {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

@media (max-width: 420px) {
  .cs-save-actions {
    grid-template-columns: 1fr;
  }
}

/* ---------- 4-digit PIN input ---------- */

.cs-pin-input-row {
  display: flex;
  gap: 10px;
}

.cs-pin-input {
  width: 52px;
  height: 56px;
  border: 1px solid var(--cs-cloud-200);
  background: var(--cs-cloud-50);
  border-radius: var(--cs-radius-sm);
  text-align: center;
  font-family: var(--cs-font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--cs-ink-950);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.cs-pin-input:focus {
  border-color: var(--cs-brand-500);
  background: var(--cs-white);
  box-shadow: 0 0 0 3px rgba(47, 116, 230, 0.14);
}

.cs-pin-input:not(:placeholder-shown) {
  border-color: var(--cs-brand-600);
}

@media (max-width: 380px) {
  .cs-pin-input-row {
    gap: 8px;
  }

  .cs-pin-input {
    width: 100%;
    height: 50px;
  }
}

/* ===========================================================
   PAGINATION CONTROLS
   =========================================================== */

.cs-save-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 4px;
}

.cs-save-pagination-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--cs-cloud-200);
  background: var(--cs-white);
  color: var(--cs-brand-700);
  font-family: var(--cs-font-display);
  font-weight: 700;
  font-size: 12.5px;
  padding: 9px 14px;
  border-radius: var(--cs-radius-pill);
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}

.cs-save-pagination-btn svg {
  width: 15px;
  height: 15px;
}

.cs-save-pagination-btn:hover:not(:disabled) {
  background: var(--cs-cloud-100);
}

.cs-save-pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.cs-save-pagination-info {
  font-size: 12px;
  font-weight: 600;
  color: var(--cs-slate-400);
  white-space: nowrap;
}