/* ===========================================================
   Soft7Digital Vault System — visual identity
   Concept: a secure filing ledger / vault register. Ink-navy
   surfaces, a brass seal as the signature mark of "delivered",
   monospace metadata columns like stamped ledger entries.
   =========================================================== */

:root {
  --ink:        #12172B;
  --ink-soft:   #1E2440;
  --paper:      #F7F5EF;
  --paper-dim:  #EFEBE0;
  --brass:      #B98A2E;
  --brass-soft: #E4C077;
  --slate:      #5B6478;
  --line:       #E4E0D4;
  --line-dark:  #2A3054;
  --success:    #2F6F4F;
  --danger:     #A6402F;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
}

a { color: inherit; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0 0 0.4em;
  letter-spacing: -0.01em;
}

.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Top bar ---------- */

.topbar {
  background: var(--ink);
  color: var(--paper);
  border-bottom: 3px solid var(--brass);
}

.topbar-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.powered-by {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  color: var(--brass-soft);
  opacity: 0.75;
  padding-left: 32px;
}

.brand .seal {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brass);
  display: inline-block;
  position: relative;
}

.topbar nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 0.92rem;
}

.topbar nav .who {
  color: var(--brass-soft);
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

.topbar nav a {
  text-decoration: none;
  color: var(--paper);
  opacity: 0.85;
}
.topbar nav a:hover { opacity: 1; }
.nav-alert-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #E85C4A;
  margin-left: 3px;
  vertical-align: middle;
}

/* ---------- Auth pages ---------- */

.auth-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% -10%, #232A4E 0%, transparent 45%),
    var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.auth-card {
  background: var(--paper);
  width: 100%;
  max-width: 420px;
  padding: 40px 36px 32px;
  border-radius: 4px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.35);
  border-top: 4px solid var(--brass);
}

.auth-card .eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 6px;
}

.auth-card h1 {
  font-size: 1.7rem;
  margin-bottom: 6px;
}

.auth-card .sub {
  color: var(--slate);
  font-size: 0.92rem;
  margin-bottom: 28px;
}

.auth-switch {
  margin-top: 22px;
  font-size: 0.88rem;
  color: var(--slate);
  text-align: center;
}
.auth-switch a { color: var(--ink); font-weight: 600; text-decoration: underline; }

/* ---------- Forms ---------- */

.field { margin-bottom: 18px; }

.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ink);
}

.field .hint {
  font-size: 0.78rem;
  color: var(--slate);
  margin-top: 4px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="file"],
select,
textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: #fff;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink);
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--brass);
  outline-offset: 1px;
  border-color: var(--brass);
}

.btn {
  display: inline-block;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 12px 22px;
  border-radius: 3px;
  text-decoration: none;
  text-align: center;
}

.btn-primary {
  background: var(--ink);
  color: var(--paper);
  width: 100%;
}
.btn-primary:hover { background: var(--ink-soft); }

.btn-brass {
  background: var(--brass);
  color: var(--ink);
}
.btn-brass:hover { background: var(--brass-soft); }

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
  font-size: 0.8rem;
  padding: 6px 12px;
}

.btn-sm { padding: 7px 14px; font-size: 0.82rem; }

/* ---------- Alerts ---------- */

.alert {
  padding: 12px 16px;
  border-radius: 3px;
  font-size: 0.88rem;
  margin-bottom: 20px;
  border-left: 3px solid;
}
.alert-error { background: #FBEAE6; border-color: var(--danger); color: #7A2E20; }
.alert-success { background: #E9F3EC; border-color: var(--success); color: #204F38; }

/* ---------- Page shell ---------- */

.page {
  padding: 44px 0 80px;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 16px;
}

.page-head .eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 6px;
  display: block;
}

.page-head h1 { font-size: 1.9rem; margin-bottom: 4px; }
.page-head p { color: var(--slate); margin: 0; font-size: 0.94rem; }
.page-head .welcome-line { color: var(--ink); font-weight: 600; font-size: 0.98rem; margin-bottom: 4px; }

/* ---------- Ledger (signature element) ---------- */

.ledger {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--line);
}

.ledger thead th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate);
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-dim);
}

.ledger tbody td {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-size: 0.92rem;
}

.ledger tbody tr:last-child td { border-bottom: none; }
.ledger tbody tr:hover { background: #FBFAF6; }

.ledger .label-cell { font-weight: 600; }
.ledger .meta { font-family: var(--font-mono); color: var(--slate); font-size: 0.82rem; }

.seal-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--brass);
  display: inline-block;
  box-shadow: 0 0 0 3px rgba(185,138,46,0.18);
}
.seal-dot.seen { background: var(--line); box-shadow: none; }

.empty-state {
  border: 1px dashed var(--line);
  padding: 60px 24px;
  text-align: center;
  color: var(--slate);
  background: #fff;
}
.empty-state h3 { color: var(--ink); margin-bottom: 8px; }

/* ---------- Cards / stats ---------- */

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-top: 3px solid var(--brass);
  padding: 18px 20px;
}

.stat .num {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 600;
}

.stat .label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--slate);
}

/* ---------- Upload form ---------- */

.upload-panel {
  background: #fff;
  border: 1px solid var(--line);
  padding: 28px;
  max-width: 560px;
}

.dropzone {
  border: 2px dashed var(--line);
  border-radius: 4px;
  padding: 34px 20px;
  text-align: center;
  color: var(--slate);
  font-size: 0.88rem;
  transition: border-color 0.15s;
}
.dropzone.drag { border-color: var(--brass); background: #FBF7EC; }

/* ---------- Client management table ---------- */

.status-pill {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: 0.03em;
}
.status-active { background: #E9F3EC; color: var(--success); }
.status-inactive { background: #F0EEE7; color: var(--slate); }
.status-archived { background: #F3EBD9; color: var(--brass); margin-left: 6px; }

/* ---------- Archiving ---------- */

.archive-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  background: #FBF7EC;
  border: 1px solid var(--brass-soft);
  padding: 16px 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.archive-banner strong { font-size: 0.94rem; }
.archive-banner p { margin: 4px 0 0; color: var(--slate); font-size: 0.85rem; max-width: 46ch; }

.archive-toggle {
  margin-top: 6px;
  margin-bottom: 26px;
}
.archive-toggle summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--slate);
  padding: 8px 0;
  list-style: none;
}
.archive-toggle summary::-webkit-details-marker { display: none; }
.archive-toggle summary::before { content: "▸ "; color: var(--brass); }
.archive-toggle[open] summary::before { content: "▾ "; }
.archive-toggle .folder-grid { margin-top: 10px; }

.rename-toggle {
  margin-bottom: 20px;
}
.rename-toggle summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--slate);
  padding: 6px 0;
  list-style: none;
}
.rename-toggle summary::-webkit-details-marker { display: none; }
.rename-toggle summary::before { content: "▸ "; color: var(--brass); }
.rename-toggle[open] summary::before { content: "▾ "; }
.rename-toggle .new-folder-form { margin-top: 10px; max-width: 420px; }

.folder-card-archived {
  opacity: 0.75;
  border-style: dashed;
}
.folder-card-archived:hover { opacity: 1; }

/* ---------- Verification code entry ---------- */

#code {
  font-size: 1.6rem;
  letter-spacing: 0.5em;
  text-align: center;
  font-family: var(--font-mono);
}

.link-button {
  background: none;
  border: none;
  padding: 0;
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.88rem;
  font-family: var(--font-body);
}
.link-button:hover { color: var(--brass); }

/* ---------- Impersonation banner ---------- */

.impersonation-banner {
  background: var(--brass);
  color: var(--ink);
  border-bottom: 2px solid var(--ink);
}
.impersonation-banner-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 24px;
  font-size: 0.88rem;
  font-weight: 600;
  flex-wrap: wrap;
  gap: 10px;
}

.trial-banner {
  background: var(--ink-soft);
  color: var(--paper);
  border-bottom: 2px solid var(--brass);
}
.trial-banner-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 24px;
  font-size: 0.86rem;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- Donut chart (per-client storage) ---------- */

.donut {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.donut-hole {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.66rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--ink);
}

/* ---------- Confirmation modal ---------- */

.confirm-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(18, 23, 43, 0.55);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.confirm-modal-overlay.open {
  display: flex;
}
.confirm-modal {
  background: var(--paper);
  border-top: 4px solid var(--danger);
  border-radius: 4px;
  padding: 28px 26px 22px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 30px 60px rgba(0,0,0,0.35);
}
.confirm-modal-message {
  font-size: 0.96rem;
  color: var(--ink);
  margin: 0 0 22px;
  line-height: 1.5;
}
.confirm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

footer.site-footer {
  text-align: center;
  padding: 30px;
  font-size: 0.78rem;
  color: var(--slate);
}

/* ---------- Landing page ---------- */

.landing-nav {
  border-bottom: 1px solid var(--line);
}

.landing-nav-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-dark { color: var(--ink); }

.landing-nav-links {
  display: flex;
  gap: 10px;
}

.hero {
  background:
    radial-gradient(circle at 85% 0%, rgba(185,138,46,0.10) 0%, transparent 45%),
    var(--paper);
  padding: 70px 0 80px;
  border-bottom: 1px solid var(--line);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}

.hero-copy h1 {
  font-size: 2.6rem;
  line-height: 1.12;
  margin: 10px 0 18px;
  max-width: 11ch;
}

.hero-sub {
  color: var(--slate);
  font-size: 1.02rem;
  max-width: 40ch;
  margin-bottom: 30px;
}

.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-cta .btn { width: auto; padding: 13px 24px; }

.hero-visual { display: flex; justify-content: center; }

.ledger-preview {
  background: #fff;
  border: 1px solid var(--line);
  border-top: 4px solid var(--brass);
  width: 100%;
  max-width: 340px;
  box-shadow: 0 24px 50px rgba(18,23,43,0.10);
}

.ledger-preview-head {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate);
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-dim);
}

.ledger-preview-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.ledger-preview-row:last-child { border-bottom: none; }

.lp-label { font-size: 0.86rem; font-weight: 600; flex: 1; }
.lp-meta { font-family: var(--font-mono); font-size: 0.74rem; color: var(--slate); font-weight: 400; }

.steps-section {
  padding: 64px 0;
}

.steps-section > .container > .eyebrow {
  display: block;
  text-align: center;
  margin-bottom: 30px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.step-num {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--brass);
  margin-bottom: 10px;
}

.step h3 { font-size: 1.1rem; margin-bottom: 8px; }
.step p { color: var(--slate); font-size: 0.92rem; margin: 0; }

.cta-band {
  background: var(--ink);
  color: var(--paper);
  padding: 54px 0;
}

.cta-band-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.cta-band h2 {
  color: var(--paper);
  font-size: 1.5rem;
  margin: 0;
}

@media (max-width: 760px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-copy h1 { max-width: none; font-size: 2.1rem; }
  .steps { grid-template-columns: 1fr; }
}

/* ---------- Folder browser ---------- */

.breadcrumb {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--slate);
  margin-bottom: 22px;
}
.breadcrumb a { text-decoration: none; color: var(--slate); }
.breadcrumb a:hover { color: var(--ink); text-decoration: underline; }
.breadcrumb a:last-child { color: var(--ink); font-weight: 600; }

.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}

.folder-card {
  display: block;
  background: #fff;
  border: 1px solid var(--line);
  padding: 18px 16px;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s, transform 0.1s;
}
.folder-card:hover { border-color: var(--brass); transform: translateY(-1px); }

.folder-icon {
  width: 30px;
  height: 22px;
  background: var(--brass-soft);
  border-radius: 0 3px 3px 3px;
  position: relative;
  margin-bottom: 12px;
}
.folder-icon::before {
  content: "";
  position: absolute;
  top: -6px;
  left: 0;
  width: 16px;
  height: 6px;
  background: var(--brass-soft);
  border-radius: 3px 3px 0 0;
}

.folder-name { font-weight: 600; font-size: 0.96rem; margin-bottom: 4px; }
.folder-meta { font-family: var(--font-mono); font-size: 0.74rem; color: var(--slate); }

.delete-folder-form {
  margin-bottom: 20px;
}

.folder-create-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-top: 3px solid var(--brass);
  padding: 18px 20px;
  margin-bottom: 26px;
  max-width: 480px;
}
.folder-create-panel h3 {
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.new-folder-form {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.new-folder-form input[type="text"] { flex: 1; }

.client-upload-form {
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.client-upload-form .field { margin-bottom: 12px; }
.client-upload-form button { align-self: flex-start; }

@media (max-width: 640px) {
  .topbar-inner { flex-direction: column; gap: 12px; align-items: flex-start; }
  .ledger thead { display: none; }
  .ledger, .ledger tbody, .ledger tr, .ledger td { display: block; width: 100%; }
  .ledger tr { border-bottom: 1px solid var(--line); padding: 12px 0; }
  .ledger td { border: none; padding: 4px 16px; }
}
