/* ============================================================
   The Private Office — Shared Styles v2
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,300&display=swap');

:root {
  --blue-vivid:   #1a3fc4;
  --blue-mid:     #2563eb;
  --blue-light:   #60a5fa;
  --white:        #ffffff;
  --text-primary: #0d1b3e;
  --text-muted:   #4a6080;

  --glass-bg:       rgba(255,255,255,0.42);
  --glass-bg-heavy: rgba(255,255,255,0.62);
  --glass-border:   rgba(255,255,255,0.75);
  --glass-blur:     blur(32px) saturate(2.2) brightness(1.05);
  --glass-shadow:   0 8px 40px rgba(15,40,120,0.12), 0 1px 0 rgba(255,255,255,0.95) inset;
}

* { box-sizing: border-box; }

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  overflow-x: hidden;
  min-height: 100vh;
  color: var(--text-primary);
  position: relative;
  background: #e8eef8;
}

/* ── Static tinted base so bg images don't dominate ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: url('bg2.png') center/cover no-repeat;
  z-index: -2;
  opacity: 0.32;
  animation: bgShift 24s ease-in-out infinite alternate;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: url('bg1.png') center/cover no-repeat;
  z-index: -1;
  opacity: 0;
  animation: bgFade 24s ease-in-out infinite alternate;
}

/* Subtle colour wash on top so glass panels pop cleanly */
body > .bg-wash {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse 120% 80% at 30% 20%, rgba(219,234,254,0.55) 0%, transparent 60%),
              radial-gradient(ellipse 80% 120% at 80% 80%, rgba(196,213,255,0.38) 0%, transparent 55%);
  pointer-events: none;
}

@keyframes bgShift {
  0%   { transform: scale(1.02) translate(0,0); }
  100% { transform: scale(1.06) translate(-1.5%,-0.8%); }
}
@keyframes bgFade {
  0%   { opacity: 0; }
  45%  { opacity: 0; }
  60%  { opacity: 0.28; }
  100% { opacity: 0.28; }
}

/* ── Core iOS glass panel ── */
.glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

/* ── Heavier glass for inner cards ── */
.glass-card {
  background: var(--glass-bg-heavy);
  backdrop-filter: blur(28px) saturate(2) brightness(1.04);
  -webkit-backdrop-filter: blur(28px) saturate(2) brightness(1.04);
  border: 1px solid rgba(255,255,255,0.85);
  box-shadow: 0 4px 24px rgba(15,40,120,0.09), 0 1px 0 rgba(255,255,255,1) inset;
  color: var(--text-primary);
}

/* ── Dark sidebar — deeper navy, better contrast ── */
.sidebar {
  background: rgba(6,18,72,0.82);
  backdrop-filter: blur(40px) saturate(1.6);
  -webkit-backdrop-filter: blur(40px) saturate(1.6);
  border-right: 1px solid rgba(255,255,255,0.09);
}

/* ── Top bar ── */
.topbar {
  background: rgba(6,18,72,0.78);
  backdrop-filter: blur(28px) saturate(1.5);
  -webkit-backdrop-filter: blur(28px) saturate(1.5);
  border-bottom: 1px solid rgba(255,255,255,0.09);
}

/* ── Steps — improved text contrast ── */
.step-item { transition: all .3s ease; }
.step-item.active   { background: rgba(59,130,246,0.26); border-color: rgba(147,197,253,0.5); }
.step-item.done     { background: rgba(16,185,129,0.16); border-color: rgba(16,185,129,0.38); }
.step-item.inactive { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.07); }

.step-num {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px; flex-shrink: 0;
  transition: all .3s;
}
.step-num.active   { background: #3b82f6; color: #fff; box-shadow: 0 0 16px rgba(59,130,246,0.55); }
.step-num.done     { background: #10b981; color: #fff; }
.step-num.inactive { background: rgba(255,255,255,0.10); color: rgba(255,255,255,0.38); }

/* Step text — make ALL sidebar text clearly readable */
.step-item .step-title-active  { color: #fff; font-weight: 600; font-size: 0.875rem; }
.step-item .step-desc-active   { color: rgba(190,214,255,0.82); font-size: 0.75rem; margin-top: 2px; }
.step-item .step-title-inactive{ color: rgba(255,255,255,0.52); font-weight: 600; font-size: 0.875rem; }
.step-item .step-desc-inactive { color: rgba(180,205,255,0.38); font-size: 0.75rem; margin-top: 2px; }

/* ── Mobile stepper ── */
.mob-step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.mob-step-dot {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; transition: all .3s;
}
.mob-step-dot.active   { background: #3b82f6; color: #fff; box-shadow: 0 0 14px rgba(59,130,246,0.5); }
.mob-step-dot.done     { background: #10b981; color: #fff; }
.mob-step-dot.inactive { background: rgba(8,25,90,0.22); color: rgba(8,25,90,0.38); }
.mob-step-line { flex: 1; height: 2px; margin-top: 15px; border-radius: 2px; transition: background .3s; }
.mob-step-line.done   { background: #10b981; }
.mob-step-line.active { background: rgba(8,25,90,0.16); }

/* ── Inputs ── */
.tpo-input {
  width: 100%;
  background: rgba(255,255,255,0.65);
  border: 1.5px solid rgba(148,163,184,0.32);
  border-radius: 14px;
  padding: 14px 16px;
  color: var(--text-primary);
  font-size: 15px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  transition: all .2s;
  backdrop-filter: blur(8px);
}
.tpo-input::placeholder { color: #94a3b8; }
.tpo-input:focus {
  border-color: var(--blue-mid);
  background: rgba(255,255,255,0.90);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.13);
}

/* ── Labels ── */
.field-label {
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-bottom: 8px;
  display: block;
}

/* ── Upload zones ── */
.upload-zone {
  border: 2px dashed rgba(148,163,184,0.42);
  border-radius: 16px;
  background: rgba(255,255,255,0.32);
  backdrop-filter: blur(8px);
  transition: all .2s;
  cursor: pointer;
}
.upload-zone:hover    { border-color: var(--blue-mid); background: rgba(219,234,254,0.42); }
.upload-zone.has-file { border-color: #10b981; background: rgba(209,250,229,0.32); }

/* ── Platform buttons ── */
.platform-btn {
  border: 1.5px solid rgba(148,163,184,0.32);
  border-radius: 14px;
  background: rgba(255,255,255,0.50);
  backdrop-filter: blur(12px);
  color: #334155;
  padding: 12px 10px;
  font-size: 14px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  transition: all .2s;
  cursor: pointer;
}
.platform-btn:hover  { border-color: var(--blue-mid); background: rgba(219,234,254,0.65); color: #1d4ed8; }
.platform-btn.chosen { border-color: #2563eb; background: rgba(219,234,254,0.80); color: #1d4ed8; }

/* ── Language dropdown ── */
.lang-menu {
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(28px) saturate(2);
  border: 1px solid rgba(255,255,255,0.95);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(15,40,120,0.22);
  color: var(--text-primary);
  z-index: 9999;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}
.lang-btn { color: #334155; transition: background .2s; }
.lang-btn:hover { background: rgba(219,234,254,0.65); }

/* ── Topbar button ── */
.topbar-btn {
  background: rgba(255,255,255,0.13);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 12px;
  color: #fff;
  padding: 8px 16px;
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  backdrop-filter: blur(8px);
  transition: all .2s;
  display: flex; align-items: center; gap: 6px;
  cursor: pointer;
}
.topbar-btn:hover {
  background: rgba(255,255,255,0.22);
  border-color: rgba(255,255,255,0.48);
}

/* ── Agreement scrollbar ── */
.agreement-scroll { scrollbar-width: thin; scrollbar-color: rgba(59,130,246,0.3) transparent; }
.agreement-scroll::-webkit-scrollbar { width: 5px; }
.agreement-scroll::-webkit-scrollbar-thumb { background: rgba(59,130,246,0.22); border-radius: 4px; }

/* ── Primary button ── */
.btn-primary {
  background: linear-gradient(135deg, #1a3fc4, #3b82f6);
  border-radius: 16px;
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  font-family: 'DM Sans', sans-serif;
  padding: 15px 24px;
  width: 100%;
  border: none;
  cursor: pointer;
  transition: all .2s;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 4px 20px rgba(26,63,196,0.32);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg,#1430a0,#2563eb);
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(26,63,196,0.42);
}
.btn-primary:disabled {
  background: rgba(148,163,184,0.26);
  color: rgba(100,116,139,0.52);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ── Checkbox ── */
input[type=checkbox] { accent-color: #2563eb; width: 18px; height: 18px; flex-shrink: 0; }

/* ── Canvas paint-blend transition overlay ── */
#paintCanvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s;
}
#paintCanvas.active { pointer-events: all; }

/* ── Animations ── */
@keyframes chartGrow { from{transform:scaleY(0.2);opacity:0} to{transform:scaleY(1);opacity:1} }
.chart-bar { animation: chartGrow .6s ease forwards; transform-origin: bottom; }

@keyframes fadeUp { from{opacity:0;transform:translateY(18px)} to{opacity:1;transform:translateY(0)} }
.fade-up { animation: fadeUp .5s cubic-bezier(.22,1,.36,1) forwards; }

@keyframes modalFadeIn { from{opacity:0;transform:translateY(-10px) scale(0.98)} to{opacity:1;transform:translateY(0) scale(1)} }
.modal-animate { animation: modalFadeIn .25s cubic-bezier(.22,1,.36,1); }

@keyframes glassIn { from{opacity:0;transform:scale(0.97) translateY(12px)} to{opacity:1;transform:scale(1) translateY(0)} }
.glass-in { animation: glassIn .6s cubic-bezier(.22,1,.36,1) both; }

/* Step section transitions — paint blend replaces slide */
.form-section { display: none; opacity: 0; }
.form-section.active {
  display: block;
  animation: sectionReveal 0.55s cubic-bezier(.22,1,.36,1) forwards;
}
@keyframes sectionReveal {
  from { opacity:0; transform:translateY(10px) scale(0.995); filter:blur(4px); }
  to   { opacity:1; transform:translateY(0) scale(1); filter:blur(0); }
}

/* ── Typography overrides for headings ── */
h1, h2, h3 { font-family: 'DM Serif Display', Georgia, serif; letter-spacing: -0.01em; }
