/* ============================================================
   MultiSig Vault dApp — indigo & sky "vault" theme
   New motion language vs Projects 01/02: floating key-shards,
   threshold rings, confirmation pulses, vault sheen sweep.
   ============================================================ */

:root {
  --bg: #0a0f1e;
  --bg-2: #0d1428;
  --card: rgba(17, 25, 46, 0.76);
  --card-border: rgba(148, 163, 184, 0.14);
  --text: #e7ecf6;
  --muted: #8e9ab4;
  --accent-1: #6366f1;  /* indigo */
  --accent-2: #38bdf8;  /* sky */
  --accent-grad: linear-gradient(135deg, #6366f1 0%, #38bdf8 100%);
  --danger: #f43f5e;
  --success: #34d399;
  --warning: #fbbf24;
  --radius: 16px;
  --font-ui: "Inter", system-ui, -apple-system, sans-serif;
  --font-display: "Space Grotesk", var(--font-ui);
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(640px 440px at 10% 8%, rgba(99, 102, 241, 0.17), transparent 60%),
    radial-gradient(720px 520px at 90% 16%, rgba(56, 189, 248, 0.13), transparent 60%),
    radial-gradient(800px 600px at 50% 100%, rgba(99, 102, 241, 0.09), transparent 60%),
    var(--bg);
  animation: glowDrift 18s ease-in-out infinite alternate;
}
@keyframes glowDrift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(24px, -14px, 0) scale(1.06); }
}

/* floating key shards */
.shards { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.shards i {
  position: absolute;
  bottom: -40px;
  width: 4px;
  height: 14px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent-1));
  border-radius: 3px 3px 2px 2px;
  opacity: 0;
  animation: shardFloat linear infinite;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.6);
}
.shards i::after {
  content: "";
  position: absolute;
  top: -6px;
  left: -3px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--accent-2);
  border-radius: 50%;
  opacity: 0.9;
}
@keyframes shardFloat {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
  10%  { opacity: 0.8; }
  90%  { opacity: 0.3; }
  100% { transform: translateY(-105vh) rotate(300deg); opacity: 0; }
}

.container { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.accent { color: var(--accent-2); }

/* ===================== HEADER ===================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(10, 15, 30, 0.74);
  border-bottom: 1px solid var(--card-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 12px; }

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 19px;
  background: rgba(99, 102, 241, 0.16);
  border: 1px solid rgba(99, 102, 241, 0.4);
  position: relative;
  overflow: hidden;
  animation: vaultPulse 3s ease-in-out infinite;
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(56, 189, 248, 0.35) 50%, transparent 70%);
  animation: sheen 4s linear infinite;
}
@keyframes sheen { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes vaultPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4); }
  50% { box-shadow: 0 0 18px 4px rgba(99, 102, 241, 0.25); }
}

.brand h1 { font-family: var(--font-display); font-size: 19px; letter-spacing: 0.2px; }
.brand-sub { font-size: 11.5px; color: var(--muted); }

.header-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.chain-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: var(--card);
  color: var(--muted);
}
.chain-badge.ok { color: var(--success); border-color: rgba(52, 211, 153, 0.35); }

/* ===================== BUTTONS & FORMS ===================== */

.btn {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  padding: 11px 18px;
  cursor: pointer;
  color: #fff;
  transition: transform 0.12s ease, filter 0.15s ease, box-shadow 0.2s ease;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn:not(:disabled):hover { transform: translateY(-1px); filter: brightness(1.08); }
.btn:not(:disabled):active { transform: translateY(0); }

.btn-primary { background: var(--accent-grad); box-shadow: 0 6px 18px rgba(99, 102, 241, 0.3); }
.btn-accent { background: linear-gradient(135deg, #38bdf8, #22d3ee); color: #04222e; box-shadow: 0 6px 18px rgba(56, 189, 248, 0.3); }
.btn-ghost { background: rgba(148, 163, 184, 0.1); border: 1px solid var(--card-border); color: var(--text); }
.btn-ghost:hover { background: rgba(148, 163, 184, 0.18); }
.btn-danger { background: var(--danger); }
.btn-sm { padding: 8px 14px; font-size: 13px; }

.link-btn {
  background: none;
  border: none;
  color: var(--accent-2);
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font-ui);
}
.link-btn:hover { text-decoration: underline; }

input, select {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--text);
  background: rgba(148, 163, 184, 0.07);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, select:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12); }

label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 12px 0 6px; }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

/* ===================== BANNER / SETTINGS ===================== */

.banner { display: flex; gap: 16px; align-items: flex-start; margin-top: 22px; border-left: 3px solid var(--warning); }
.banner-icon { font-size: 26px; }
.banner h3 { font-family: var(--font-display); margin-bottom: 4px; }
.banner p { font-size: 13.5px; color: var(--muted); margin-bottom: 12px; }
.banner code, .settings-panel code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: rgba(148, 163, 184, 0.12);
  padding: 2px 6px;
  border-radius: 6px;
  color: var(--accent-2);
}

.settings-panel { margin-top: 22px; }
.settings-panel h3 { font-family: var(--font-display); margin-bottom: 14px; }
.settings-panel .row { margin-top: 16px; }

/* ===================== CARDS / SECTIONS ===================== */

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(10px);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.25s ease;
  animation: cardIn 0.5s ease both;
}
.card:hover { border-color: rgba(99, 102, 241, 0.32); transform: translateY(-2px); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35); }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.card-head h3 { font-family: var(--font-display); font-size: 16.5px; }
.card-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-2);
  font-size: 16px;
}
.card p { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.card form .btn { width: 100%; margin-top: 14px; }

.section { margin-top: 46px; }
.section-title { font-family: var(--font-display); font-size: 20px; margin-bottom: 18px; }
.section-title .muted { font-size: 13px; font-weight: 400; }

.tag {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.18);
  color: #c7d2fe;
  vertical-align: middle;
}
.tag-admin { background: rgba(52, 211, 153, 0.15); color: #6ee7b7; }

/* ===================== HERO ===================== */

.hero {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 28px;
  margin-top: 34px;
  align-items: center;
}
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } }

.hero-text h2 { font-family: var(--font-display); font-size: 40px; letter-spacing: -0.5px; }
.hero-text h2 span { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-text p { font-size: 14.5px; margin-top: 10px; max-width: 52ch; }
.hero-links { margin-top: 14px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.hero-links a { color: var(--accent-2); text-decoration: none; }
.hero-links a:hover { text-decoration: underline; }
#hero-address { font-family: var(--font-mono); font-size: 12.5px; }

.deposit-box {
  margin-top: 18px;
  padding: 14px;
  border: 1px dashed rgba(99, 102, 241, 0.4);
  border-radius: 12px;
  max-width: 420px;
}
.deposit-box .row { margin-top: 8px; }
.deposit-box input { flex: 1; min-width: 120px; }
.deposit-box .btn { margin: 0; width: auto; }

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stat-wide { grid-column: 1 / -1; }
.stat-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); }
.stat-value { font-family: var(--font-display); font-size: 21px; font-weight: 600; }
.stat-small { font-family: var(--font-mono); font-size: 13px; word-break: break-all; }

/* ===================== OWNERS ===================== */

.owners-strip { display: flex; gap: 12px; flex-wrap: wrap; }
.owner-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 8px 14px 8px 8px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  animation: cardIn 0.5s ease both;
}
.owner-chip.me { border-color: rgba(52, 211, 153, 0.5); }
.owner-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  background: var(--accent-grad);
  color: #fff;
}
.owner-chip .me-badge { font-size: 10px; font-weight: 700; color: var(--success); text-transform: uppercase; }

/* ===================== CREATE TX ===================== */

.create-card { border: 1px solid rgba(99, 102, 241, 0.3); }
.create-row { display: grid; grid-template-columns: 1.2fr 0.8fr 1.2fr auto; gap: 14px; align-items: end; }
.create-row .btn { margin-top: 0; height: 42px; padding: 0 22px; }
.create-row label { margin: 0; }
@media (max-width: 900px) { .create-row { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .create-row { grid-template-columns: 1fr; } }

/* ===================== TRANSACTIONS ===================== */

.tx-list { display: flex; flex-direction: column; gap: 12px; }

.tx-card {
  display: grid;
  grid-template-columns: 92px 1fr auto;
  gap: 18px;
  align-items: center;
  animation: cardIn 0.45s ease both;
}
@media (max-width: 760px) { .tx-card { grid-template-columns: 1fr; } }

/* threshold ring */
.ring-wrap { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ring { position: relative; width: 64px; height: 64px; }
.ring svg { width: 64px; height: 64px; transform: rotate(-90deg); }
.ring .ring-bg { fill: none; stroke: rgba(148, 163, 184, 0.15); stroke-width: 7; }
.ring .ring-fill {
  fill: none;
  stroke: url(#ringGrad);
  stroke-width: 7;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.25, 1, 0.35, 1);
}
.ring .ring-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
}
.ring.met .ring-label { color: var(--success); text-shadow: 0 0 10px rgba(52, 211, 153, 0.7); }
.ring.met .ring-fill { animation: metGlow 1.6s ease-in-out infinite; }
@keyframes metGlow {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(52, 211, 153, 0.5)); }
  50% { filter: drop-shadow(0 0 8px rgba(52, 211, 153, 0.9)); }
}

.tx-main h4 { font-family: var(--font-display); font-size: 15.5px; margin-bottom: 4px; }
.tx-main .meta { font-size: 12.5px; color: var(--muted); font-family: var(--font-mono); word-break: break-all; }
.tx-main .meta a { color: var(--accent-2); text-decoration: none; }
.tx-main .meta a:hover { text-decoration: underline; }

.tx-state { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; padding: 3px 9px; border-radius: 999px; }
.state-pending { background: rgba(99, 102, 241, 0.18); color: #c7d2fe; }
.state-pending.pulse { animation: softPulse 1.8s ease-in-out infinite; }
.state-executed { background: rgba(52, 211, 153, 0.16); color: #6ee7b7; }
.state-failed { background: rgba(244, 63, 94, 0.14); color: #fda4af; }
@keyframes softPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.35); }
  50% { box-shadow: 0 0 10px 2px rgba(99, 102, 241, 0.2); }
}

.tx-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tx-actions .btn { margin: 0; width: auto; }

.confirmers { margin-top: 8px; font-size: 12px; color: var(--muted); font-family: var(--font-mono); }

/* ===================== ACTIVITY TABLE ===================== */

.table-card { padding: 8px 20px 20px; overflow-x: auto; }
.activity-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 560px; }
.activity-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  padding: 14px 12px;
  border-bottom: 1px solid var(--card-border);
}
.activity-table td { padding: 12px; border-bottom: 1px solid rgba(148, 163, 184, 0.07); }
.activity-table tr:last-child td { border-bottom: none; }
.activity-table .mono { font-family: var(--font-mono); font-size: 12px; }
.activity-table a { color: var(--accent-2); text-decoration: none; }
.activity-table a:hover { text-decoration: underline; }

.ev-pill {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
}
.ev-Submission { background: rgba(99, 102, 241, 0.18); color: #c7d2fe; }
.ev-Confirmation { background: rgba(56, 189, 248, 0.16); color: #7dd3fc; }
.ev-Revocation { background: rgba(251, 191, 36, 0.15); color: #fcd34d; }
.ev-Execution { background: rgba(52, 211, 153, 0.16); color: #6ee7b7; }
.ev-ExecutionFailure { background: rgba(244, 63, 94, 0.14); color: #fda4af; }
.ev-Deposit { background: rgba(56, 189, 248, 0.16); color: #7dd3fc; }
.ev-ThresholdChanged { background: rgba(251, 191, 36, 0.15); color: #fcd34d; }

/* ===================== FOOTER ===================== */

.site-footer { margin-top: 60px; border-top: 1px solid var(--card-border); background: rgba(10, 15, 30, 0.6); }
.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 22px 20px;
  font-size: 12.5px;
  color: var(--muted);
}
.footer-inner a { color: var(--accent-2); text-decoration: none; }
.footer-inner a:hover { text-decoration: underline; }
#footer-address { font-family: var(--font-mono); }

/* ===================== TOASTS ===================== */

.toast-container {
  position: fixed;
  top: 84px;
  right: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
}

.toast {
  background: rgba(17, 25, 46, 0.96);
  border: 1px solid var(--card-border);
  border-left: 3px solid var(--accent-2);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 13px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  animation: toastIn 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.3);
  word-break: break-word;
}
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--accent-2); }
.toast a { color: #7dd3fc; }
.toast.out { opacity: 0; transform: translateX(12px); transition: all 0.25s ease; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(28px) scale(0.9); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

/* ===================== MISC ===================== */

[hidden] { display: none !important; }

.spin {
  display: inline-block;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

::selection { background: rgba(99, 102, 241, 0.4); }
