/* ═══════════════════════════════════════════════════════════════
   Wealth Wave Financial — Vault workspace
   Page-specific layer for index.html. Loaded after styles.css so it
   can restyle the shared shell without affecting the other pages.
   ═══════════════════════════════════════════════════════════════ */

:root {
  --surface-1:    #0c1f34;
  --surface-2:    #102942;
  --surface-3:    #16324f;
  --line:         rgba(146, 180, 214, 0.16);
  --line-strong:  rgba(146, 180, 214, 0.28);
  --ink:          #eaf2fa;
  --ink-2:        #b3c6da;
  --ink-3:        #7e97b0;
  --brand:        #3a8ed0;
  --brand-soft:   rgba(58, 142, 208, 0.12);
  --danger:       #e8705f;
  --danger-soft:  rgba(232, 112, 95, 0.12);
  --success:      #45c07a;
  --r-sm:         8px;
  --r-md:         12px; 
  --r-lg:         16px;
}

/* Calms the animated background blob so the workspace reads first. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(8, 25, 41, 0.18) 0%, rgba(6, 18, 30, 0.74) 70%),
    linear-gradient(180deg, rgba(6, 18, 30, 0.35) 0%, rgba(6, 18, 30, 0.72) 100%);
}

/* ─── Shell ─────────────────────────────────────────────────────── */
.vault {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 108px 28px 72px;
}

/* ─── Page header ───────────────────────────────────────────────── */
.vault-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding-bottom: 22px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.vault-eyebrow {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 8px;
}

.vault-title {
  font-family: 'Inter', sans-serif;
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.15;
}

.vault-sub {
  margin-top: 7px;
  font-size: 0.9rem;
  color: var(--ink-3);
  max-width: 52ch;
  line-height: 1.55;
}

.vault-head-aside {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink-2);
  font-size: 0.78rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
a.pill:hover {
  border-color: var(--line-strong);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
}

.pill-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(69, 192, 122, 0.16);
}

/* ─── Metrics ───────────────────────────────────────────────────── */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 26px;
}

.metric {
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface-1) 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px 18px 15px;
}

.metric-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 10px;
}

.metric-value {
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.metric-foot {
  margin-top: 6px;
  font-size: 0.74rem;
  color: var(--ink-3);
}

.metric.is-accent .metric-value { color: #6fb6ea; }
.metric.is-money  .metric-value { color: var(--success); }

/* ─── Workspace grid ────────────────────────────────────────────── */
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
}

/* ─── Panels ────────────────────────────────────────────────────── */
.panel {
  background: linear-gradient(180deg, rgba(16, 41, 66, 0.92) 0%, rgba(10, 27, 45, 0.94) 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: 0 18px 44px rgba(2, 10, 20, 0.42);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Lets both panels end on the same line regardless of field count. */
.panel > form {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.panel-title {
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.panel-desc {
  margin-top: 5px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--ink-3);
  max-width: 44ch;
}

.panel-tag {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-3);
}
.panel-tag.tone-brand  { color: #6fb6ea; border-color: rgba(58, 142, 208, 0.4);  background: var(--brand-soft); }
.panel-tag.tone-danger { color: var(--danger); border-color: rgba(232, 112, 95, 0.4); background: var(--danger-soft); }

.panel-body { padding: 22px; flex: 1; }

.panel-foot {
  padding: 16px 22px;
  border-top: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.16);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.panel-foot-note {
  font-size: 0.76rem;
  color: var(--ink-3);
  line-height: 1.5;
  flex: 1 1 180px;
}

/* ─── Fields ────────────────────────────────────────────────────── */
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: 7px;
}

.field-label .req      { color: var(--danger); margin-left: 2px; }
.field-label .optional {
  color: var(--ink-3);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
}

.field-input {
  width: 100%;
  height: 44px;
  background: rgba(4, 14, 25, 0.6);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  font-size: 0.92rem;
  padding: 0 13px;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}

.field-input::placeholder { color: rgba(126, 151, 176, 0.7); }

.field-input:hover { border-color: var(--line-strong); }

.field-input:focus {
  border-color: var(--brand);
  background: rgba(4, 14, 25, 0.85);
  box-shadow: 0 0 0 3px rgba(58, 142, 208, 0.16);
}

.field-input.invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(232, 112, 95, 0.14);
}

select.field-input {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' stroke='%237e97b0' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
select.field-input option { background: #0c1f34; color: var(--ink); }

input[type="date"].field-input::-webkit-calendar-picker-indicator {
  filter: invert(64%) sepia(10%) saturate(600%) hue-rotate(170deg);
  cursor: pointer;
}

.field-hint {
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--ink-3);
  line-height: 1.45;
}

/* Currency prefix */
.input-affix { position: relative; }
.input-affix .affix {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.92rem;
  color: var(--ink-3);
  pointer-events: none;
}
.input-affix .field-input { padding-left: 28px; }

/* ─── Consent row ───────────────────────────────────────────────── */
.consent {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.02);
}

.consent .checkbox-label {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  cursor: pointer;
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--ink-2);
}

.consent .checkbox-label input { position: absolute; opacity: 0; width: 0; height: 0; }

.consent .checkmark {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 5px;
  border: 1.5px solid var(--line-strong);
  background: rgba(4, 14, 25, 0.6);
  flex-shrink: 0;
  position: relative;
  transition: border-color 0.18s, background 0.18s;
}

.consent .checkbox-label input:checked + .checkmark {
  background: var(--brand);
  border-color: var(--brand);
}
.consent .checkbox-label input:checked + .checkmark::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.consent .checkbox-label input.invalid + .checkmark {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(232, 112, 95, 0.14);
}

/* ─── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 44px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.18s, border-color 0.18s, opacity 0.18s, transform 0.12s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary {
  background: var(--brand);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: #4a9cdb; }

.btn-danger {
  background: transparent;
  border-color: rgba(232, 112, 95, 0.45);
  color: var(--danger);
}
.btn-danger:hover:not(:disabled) {
  background: var(--danger-soft);
  border-color: var(--danger);
}

.btn .btn-icon { font-size: 1rem; line-height: 1; }

.btn.loading .btn-icon {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btnSpin 0.7s linear infinite;
  font-size: 0;
}
@keyframes btnSpin { to { transform: rotate(360deg); } }

/* ─── Inline status ─────────────────────────────────────────────── */
.status {
  display: none;
  margin-top: 16px;
  padding: 11px 14px;
  border-radius: var(--r-sm);
  font-size: 0.82rem;
  line-height: 1.5;
  border: 1px solid transparent;
}
.status.visible { display: block; }
.status.error   { background: var(--danger-soft);  border-color: rgba(232, 112, 95, 0.35); color: #f3a093; }
.status.success { background: rgba(69, 192, 122, 0.1); border-color: rgba(69, 192, 122, 0.35); color: #7ad4a1; }

/* ─── Footer ────────────────────────────────────────────────────── */
.vault-footer {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 26px 28px 44px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.vault-footer-text {
  font-size: 0.78rem;
  color: var(--ink-3);
  line-height: 1.6;
}

.vault-footer-links {
  display: flex;
  align-items: center;
  gap: 18px;
}

.vault-footer-links a {
  font-size: 0.78rem;
  color: var(--ink-3);
  text-decoration: none;
  transition: color 0.2s;
}
.vault-footer-links a:hover { color: var(--ink); }

/* ─── Success / error modal refinements ─────────────────────────── */
.modal-card {
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface-1) 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 40px 36px 32px;
  max-width: 470px;
}
.modal-title {
  font-family: 'Inter', sans-serif;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.modal-details {
  background: rgba(4, 14, 25, 0.5);
  border-color: var(--line);
  border-radius: var(--r-md);
}
.modal-btn {
  border-radius: var(--r-sm);
  font-weight: 600;
  padding: 12px 20px;
  white-space: nowrap;
}
.modal-btn.primary {
  background: var(--brand);
  box-shadow: none;
}
.modal-btn.primary:hover { background: #4a9cdb; }
.modal-btn:hover { transform: none; }

/* ─── Responsive ────────────────────────────────────────────────── */
@media (max-width: 980px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .metrics   { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
  .vault { padding: 96px 16px 56px; }
  .vault-title { font-size: 1.45rem; }
  .metrics { gap: 10px; }
  .metric { padding: 13px 14px; }
  .metric-value { font-size: 1.35rem; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .field-row .field { margin-bottom: 16px; }
  .panel-body { padding: 18px; }
  .panel-head { padding: 16px 18px; }
  .panel-foot { padding: 14px 18px; }
  .panel-foot .btn { width: 100%; }
  .vault-footer { padding: 22px 16px 40px; }
}
