/* ========================================
   SKYBENN STUDIOS FORMS
   Dark, minimal, gold — matches brand
======================================== */
:root {
  --bg: #0a0a0a;
  --bg-card: #141414;
  --bg-elevated: #1e1e1e;
  --border: #262626;
  --text: #f2f2f2;
  --text-muted: #9a9a9a;
  --accent: #d4af37;
  --accent-hover: #e5c453;
  --danger: #ef4444;
  --success: #22c55e;
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  background-image: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(212, 175, 55, 0.06), transparent);
  color: var(--text);
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  min-height: 100vh;
  margin: 0;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

.card, .modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 14px;
}

.form-control, .form-select, textarea {
  background: var(--bg-elevated) !important;
  border: 1px solid var(--border) !important;
  color: var(--text) !important;
  border-radius: 10px !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-control:focus, .form-select:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 0.25rem rgba(212, 175, 55, 0.12) !important;
}
.form-control::placeholder { color: #5f5f5f; }
.form-check-input { background-color: var(--bg-elevated); border-color: #3a3a3a; }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }

.btn { border-radius: 10px; transition: all 0.2s ease; }
.btn-accent {
  background: var(--accent);
  border: none;
  color: #0a0a0a;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.btn-accent:hover {
  background: var(--accent-hover);
  color: #0a0a0a;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.25);
}
.btn-accent:active { transform: translateY(0); }
.btn-outline-light { border-color: #3a3a3a; color: var(--text-muted); }
.btn-outline-light:hover { background: var(--bg-elevated); border-color: #4a4a4a; color: var(--text); }

.text-muted, .form-text { color: var(--text-muted) !important; }

.table { color: var(--text); --bs-table-bg: transparent; --bs-table-color: var(--text); }
.table > :not(caption) > * > * { border-color: var(--border); background: transparent; color: var(--text); }
.table-hover > tbody > tr:hover > * { background: var(--bg-elevated); color: var(--text); }

.nav-tabs { border-color: var(--border); }
.nav-tabs .nav-link { color: var(--text-muted); border: none; }
.nav-tabs .nav-link.active {
  background: transparent;
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
}

.badge-pending { background: #2e2e2e; color: var(--text); }
.badge-completed { background: rgba(34, 197, 94, 0.15); color: var(--success); }
.badge-expired, .badge-revoked { background: rgba(239, 68, 68, 0.15); color: var(--danger); }

/* ========================================
   ADMIN — sidebar layout
======================================== */
.admin-shell { display: flex; min-height: 100vh; }

.admin-sidebar {
  width: 250px;
  flex-shrink: 0;
  background: #111;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--border);
}
.sidebar-brand img { width: 38px; height: 38px; border-radius: 50%; box-shadow: 0 0 0 1px var(--border); }
.sidebar-brand .sb-name { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em; }
.sidebar-brand .sb-sub { font-size: 0.68rem; color: var(--text-muted); letter-spacing: 0.05em; }

.sidebar-nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.sb-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 0.92rem;
  margin-bottom: 2px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.sb-item .sb-label { display: inline-flex; align-items: center; gap: 9px; }
.sb-icon { width: 16px; height: 16px; flex-shrink: 0; }
.sb-item:hover { background: var(--bg-elevated); color: var(--text); }
.sb-item.active { background: rgba(212, 175, 55, 0.12); color: var(--accent); font-weight: 600; }
.sb-item .sb-count {
  font-size: 0.72rem;
  background: var(--bg-elevated);
  color: var(--text-muted);
  border-radius: 99px;
  padding: 1px 8px;
}
.sb-item.active .sb-count { background: rgba(212,175,55,0.2); color: var(--accent); }
.sidebar-section-label {
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #5a5a5a;
  padding: 14px 14px 6px;
}
.sidebar-foot { padding: 12px 10px; border-top: 1px solid var(--border); }
.sb-link {
  display: block; width: 100%; text-align: left;
  background: transparent; border: none; color: var(--text-muted);
  padding: 9px 14px; border-radius: 10px; font-size: 0.88rem; cursor: pointer;
}
.sb-link:hover { background: var(--bg-elevated); color: var(--text); }

.admin-main { flex: 1; padding: 32px 36px; max-width: 1000px; }
.view-title { font-size: 1.4rem; font-weight: 600; margin-bottom: 22px; }
.section-title {
  font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-muted); margin: 4px 0 12px;
}

@media (max-width: 767px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar {
    position: fixed; z-index: 200; height: 100vh; left: 0; top: 0;
    transform: translateX(-100%); transition: transform 0.25s ease;
    box-shadow: 0 0 40px rgba(0,0,0,0.6);
  }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { padding: 20px 18px; max-width: 100%; }
}
.stat-card {
  background: linear-gradient(180deg, #161616, #121212);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 16px;
  text-align: center;
}
.stat-num {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
}
.stat-label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ========================================
   CLIENT FORM FLOW
======================================== */
.flow-container { max-width: 640px; margin: 0 auto; padding: 8px 20px 90px; }

.brand-header {
  text-align: center;
  padding: 40px 0 24px;
}
.brand-header img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  margin-bottom: 14px;
  box-shadow: 0 0 0 1px var(--border), 0 0 30px rgba(212, 175, 55, 0.15);
}
.brand-header h1 {
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--text);
  margin: 0;
}
.brand-header .tagline {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 6px;
}

.progress {
  background: var(--bg-elevated);
  height: 4px;
  border-radius: 99px;
  overflow: visible;
}
.progress-bar {
  background: linear-gradient(90deg, #b8932a, var(--accent));
  border-radius: 99px;
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.5);
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Step entrance animation */
.step-anim { animation: stepIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes stepIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.question-card {
  background: linear-gradient(180deg, #161616, #121212);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 36px 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
@media (max-width: 480px) { .question-card { padding: 28px 20px; } }

.question-card h2 {
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 22px;
}

.step-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

/* Welcome screen */
.doc-badge {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  border-radius: 18px;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.doc-badge svg { width: 30px; height: 30px; }
.btn-icon { width: 17px; height: 17px; vertical-align: -3px; margin-right: 6px; }
.success-check svg { width: 38px; height: 38px; }
.welcome-steps {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin: 22px 0 6px;
  flex-wrap: wrap;
}
.welcome-steps .ws {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.welcome-steps .ws .n {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}

/* Document review */
.document-paper {
  background: #faf8f3;
  color: #1c1c1e;
  border-radius: 12px;
  padding: 36px 32px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.95rem;
  line-height: 1.75;
  white-space: pre-wrap;
  max-height: 55vh;
  overflow-y: auto;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.08), 0 10px 40px rgba(0, 0, 0, 0.4);
}
@media (max-width: 480px) { .document-paper { padding: 24px 18px; font-size: 0.88rem; } }
.document-paper .filled {
  background: linear-gradient(180deg, transparent 55%, rgba(212, 175, 55, 0.35) 55%);
  padding: 0 2px;
  font-weight: 700;
}

/* Signature */
.sig-canvas-wrap {
  background: #faf8f3;
  border-radius: 12px;
  position: relative;
  touch-action: none;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.08);
}
#sig-canvas { width: 100%; height: 180px; display: block; border-radius: 12px; cursor: crosshair; }
.sig-line {
  position: absolute;
  left: 8%; right: 8%; bottom: 38px;
  border-bottom: 1.5px solid #c5bda9;
  pointer-events: none;
}
.sig-line::before {
  content: '✕';
  position: absolute;
  left: 0; bottom: 4px;
  color: #c5bda9;
  font-size: 0.85rem;
}
.sig-hint {
  position: absolute;
  bottom: 12px; left: 0; right: 0;
  text-align: center;
  color: #b3ac99;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  pointer-events: none;
}
.typed-sig-preview {
  background: #faf8f3;
  color: #1d1d4f;
  border-radius: 12px;
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Brush Script MT', 'Segoe Script', cursive;
  font-size: 2.1rem;
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* Signature method toggle */
.btn-group .btn-check:checked + .btn {
  background: rgba(212, 175, 55, 0.12);
  border-color: var(--accent);
  color: var(--accent);
}

.spinner-overlay {
  position: fixed; inset: 0;
  background: rgba(10, 10, 10, 0.88);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 14px;
  z-index: 2000;
}

.placeholder-chip {
  display: inline-block;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 8px;
  font-family: monospace;
  font-size: 0.82rem;
  margin: 2px;
  color: var(--accent);
}

/* How-To tab */
.help-content pre {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--accent);
  font-size: 0.85rem;
  white-space: pre-wrap;
}
.help-content code {
  background: var(--bg-elevated);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--accent);
  font-size: 0.85em;
}
.help-content h6 { color: var(--text); margin-top: 8px; }

/* Success screen */
.success-check {
  width: 84px; height: 84px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: var(--success);
  font-size: 2.4rem;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 22px;
  animation: pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both;
}
@keyframes pop {
  from { transform: scale(0.4); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.footer-note {
  text-align: center;
  color: #4a4a4a;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  margin-top: 28px;
}
