/* ==========================================================================
   KARIRLOLOS STUDIO — COINBASE SPAIN STYLE REFERENCE (DESIGN (1).md)
   Digital Trust, Blueprinted · #ffffff + #0a0b0d + #0052ff Electric Blue
   24px Cards · 56px Primary Buttons · 100000px Filter Tags · 8px Inputs
   Zero Box-Shadows · Zero Gradients · Color Blocking Hierarchy
   ========================================================================== */

:root {
  --color-coinbase-blue: #0052ff;
  --color-coinbase-blue-hover: #0045d8;
  --color-interactive-blue: #578bfa;
  --color-pure-white: #ffffff;
  --color-midnight: #0a0b0d;
  --color-slate: #5b616e;
  --color-ash: #8a919e;
  --color-frost: #f7f8f9;
  --color-cloud: #eef0f3;
  --color-pewter: #dedfe2;
  --color-charcoal: #141519;
  --color-positive-green: #27ad75;
  --color-negative-red: #f0616d;

  /* Theme Semantic Surfaces (Light Default) */
  --bg-canvas: #ffffff;
  --bg-sidebar: #f7f8f9;
  --bg-card: #f7f8f9;
  --bg-card-elevated: #ffffff;
  --bg-cloud: #eef0f3;
  --bg-input: #ffffff;
  --border-subtle: #dedfe2;
  --text-primary: #0a0b0d;
  --text-secondary: #5b616e;
  --text-helper: #8a919e;

  /* Typography */
  --font-display: 'Manrope', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Named Radii from DESIGN (1).md */
  --radius-tags: 100000px;
  --radius-cards: 24px;
  --radius-inputs: 8px;
  --radius-buttons: 56px;
}

[data-theme="dark"] {
  --bg-canvas: #0a0b0d;
  --bg-sidebar: #141519;
  --bg-card: #141519;
  --bg-card-elevated: #1c1e24;
  --bg-cloud: #22252d;
  --bg-input: #0a0b0d;
  --border-subtle: #2a2d37;
  --text-primary: #ffffff;
  --text-secondary: #b1b7c3;
  --text-helper: #8a919e;
}

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

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* TYPOGRAPHY SCALE */
.display-title {
  font-family: var(--font-display);
  font-size: clamp(32px, 3.6vw, 46px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 2.5vw, 32px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.card-title {
  font-family: var(--font-sans);
  font-size: 19px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

.slate-copy {
  color: var(--text-secondary);
  font-size: 15.5px;
  line-height: 1.52;
}

.caption-label {
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

/* BUTTONS & TAGS (ZERO SHADOW, 56px PRIMARY, 100000px SECONDARY/TAG) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius-buttons);
  border: 1px solid transparent;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  box-shadow: none;
}

.btn-primary {
  background-color: var(--color-coinbase-blue);
  color: var(--color-pure-white);
  border-radius: var(--radius-buttons);
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--color-coinbase-blue-hover);
}

.btn-secondary {
  background-color: var(--bg-cloud);
  color: var(--text-primary);
  border-radius: var(--radius-tags);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--border-subtle);
  opacity: 0.92;
}

.btn-white-pill {
  background-color: var(--color-pure-white);
  color: var(--color-midnight);
  border-radius: var(--radius-tags);
  padding: 12px 24px;
}

.btn-white-pill:hover {
  background-color: var(--color-cloud);
}

.btn-midnight-pill {
  background-color: var(--color-midnight);
  color: var(--color-pure-white);
  border-radius: var(--radius-tags);
  padding: 12px 24px;
}

[data-theme="dark"] .btn-midnight-pill {
  background-color: #262932;
}

.btn-sm {
  padding: 9px 18px;
  font-size: 13.5px;
}

.ghost-link {
  background: transparent;
  border: none;
  color: var(--color-interactive-blue);
  font-family: var(--font-sans);
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
}

.ghost-link:hover {
  text-decoration: underline;
}

/* PILL TAGS (100000px) */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-tags);
  background-color: var(--bg-cloud);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.2;
}

.status-pill.blue {
  background-color: var(--color-coinbase-blue);
  color: var(--color-pure-white);
}

.status-pill.green {
  background-color: rgba(39, 173, 117, 0.14);
  color: var(--color-positive-green);
}

.status-pill.dark-pill {
  background-color: #1f2229;
  color: #ffffff;
}

/* CARDS (24px RADIUS, 24px PADDING, ZERO SHADOW — COLOR BLOCKED) */
.blueprint-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-cards);
  padding: 24px;
  min-width: 0;
  box-shadow: none;
}

.white-card {
  background-color: var(--bg-card-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-cards);
  padding: 24px;
  min-width: 0;
  box-shadow: none;
}

.midnight-card {
  background-color: var(--color-midnight);
  color: var(--color-pure-white);
  border-radius: var(--radius-cards);
  padding: 28px;
  min-width: 0;
  box-shadow: none;
}

[data-theme="dark"] .midnight-card {
  background-color: #16181f;
  border: 1px solid #2a2d37;
}

/* INPUTS (8px RADIUS per DESIGN (1).md) */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.field label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
}

.field input[type="text"],
.field input[type="email"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-inputs);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-input);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 15px;
  outline: none;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--color-coinbase-blue);
  outline: 2px solid rgba(0, 82, 255, 0.2);
}

.field textarea {
  min-height: 86px;
  resize: vertical;
  line-height: 1.5;
}

/* ================= LOGIN SCREEN ================= */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background-color: var(--bg-frost, #f7f8f9);
}

[data-theme="dark"] .login-screen {
  background-color: #0a0b0d;
}

.login-split {
  width: 100%;
  max-width: 1040px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 24px;
  align-items: stretch;
}

.login-hero-block {
  background-color: var(--color-midnight);
  color: var(--color-pure-white);
  border-radius: var(--radius-cards);
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
}

.login-feature-pills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.login-mini-stat {
  background-color: var(--color-charcoal);
  border-radius: 16px;
  padding: 14px;
}

.login-form-block {
  background-color: var(--bg-card-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-cards);
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ================= STUDIO SHELL + SIDEBAR ================= */
.studio-shell {
  display: none;
  min-height: 100vh;
}

.studio-shell.active {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
}

.sidebar {
  background-color: var(--bg-sidebar);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 10px 20px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background-color: var(--color-coinbase-blue);
  color: var(--color-pure-white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  display: block;
  line-height: 1.1;
}

.brand-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

.nav-group-label {
  padding: 14px 14px 6px;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-helper);
}

.nav-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-tags);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 14.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.nav-btn:hover {
  background-color: var(--bg-cloud);
  color: var(--text-primary);
}

.nav-btn.active {
  background-color: var(--color-coinbase-blue);
  color: var(--color-pure-white);
}

.nav-btn-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.nav-count {
  padding: 2px 9px;
  border-radius: var(--radius-tags);
  background-color: var(--bg-cloud);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  flex-shrink: 0;
}

.nav-btn.active .nav-count {
  background-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  display: grid;
  gap: 8px;
}

/* MAIN WORKSPACE */
.main-area {
  min-width: 0;
  background-color: var(--bg-canvas);
}

.mobile-topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  background-color: var(--bg-sidebar);
  position: sticky;
  top: 0;
  z-index: 40;
}

.workspace-wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 32px 32px 96px;
}

.view-pane {
  display: none;
}

.view-pane.active {
  display: block;
}

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

/* GRIDS */
.metrics-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.metric-val {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 10px 0 4px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

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

/* WIZARD STEPPER */
.wizard-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.step-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: var(--radius-tags);
  border: none;
  background-color: var(--bg-card);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.step-tab.active {
  background-color: var(--color-coinbase-blue);
  color: var(--color-pure-white);
}

.step-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background-color: var(--bg-cloud);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-tab.active .step-circle {
  background-color: var(--color-pure-white);
  color: var(--color-coinbase-blue);
}

.wiz-step-pane {
  display: none;
}

.wiz-step-pane.active {
  display: block;
}

/* PRESET ROLE PILLS */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.role-chip {
  padding: 12px 16px;
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-card-elevated);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.role-chip.active {
  background-color: var(--color-midnight);
  border-color: var(--color-midnight);
  color: var(--color-pure-white);
}

[data-theme="dark"] .role-chip.active {
  background-color: var(--color-coinbase-blue);
  border-color: var(--color-coinbase-blue);
}

/* ATS SCORE METER */
.ats-bar-track {
  width: 100%;
  height: 10px;
  border-radius: var(--radius-tags);
  background-color: var(--bg-cloud);
  overflow: hidden;
  margin: 10px 0 14px;
}

.ats-bar-fill {
  height: 100%;
  border-radius: var(--radius-tags);
  background-color: var(--color-positive-green);
  transition: width 0.25s ease;
}

/* STEP 3 SPLIT PREVIEW */
.preview-layout {
  display: grid;
  grid-template-columns: 1.18fr 0.82fr;
  gap: 22px;
  align-items: start;
}

.cv-paper {
  background-color: #ffffff;
  color: #0a0b0d;
  border: 1px solid #dedfe2;
  border-radius: var(--radius-cards);
  padding: 32px;
  min-width: 0;
}

.cv-paper-rule {
  height: 4px;
  background-color: var(--color-coinbase-blue);
  border-radius: 4px;
  margin-bottom: 18px;
}

.cv-sec-head {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-coinbase-blue);
  border-bottom: 1px solid #dedfe2;
  padding-bottom: 4px;
  margin: 16px 0 8px;
}

/* FILTER TAGS (DESIGN (1).md: 12px 24px / compact pill, 100000px radius, Slate text) */
.filter-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.filter-tag {
  padding: 9px 18px;
  border-radius: var(--radius-tags);
  border: 1px solid var(--border-subtle);
  background-color: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.filter-tag.active {
  background-color: var(--color-coinbase-blue);
  border-color: var(--color-coinbase-blue);
  color: var(--color-pure-white);
}

.lib-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.lib-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-cards);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}

/* MODAL DETAIL */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 11, 13, 0.72);
  z-index: 80;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  background-color: var(--bg-card-elevated);
  border-radius: var(--radius-cards);
  padding: 30px;
}

.example-box {
  background-color: var(--bg-card);
  border-left: 4px solid var(--color-coinbase-blue);
  border-radius: 12px;
  padding: 16px;
  margin: 14px 0;
  white-space: pre-line;
  font-size: 14.5px;
  line-height: 1.55;
}

/* MOBILE BOTTOM NAV & DRAWER */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--bg-card-elevated);
  border-top: 1px solid var(--border-subtle);
  padding: 8px 10px;
  z-index: 45;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.mob-nav-item {
  padding: 9px 4px;
  border-radius: var(--radius-tags);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

.mob-nav-item.active {
  background-color: var(--color-coinbase-blue);
  color: var(--color-pure-white);
}

.drawer-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 11, 13, 0.6);
  z-index: 55;
}

.toast-banner {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background-color: var(--color-midnight);
  color: var(--color-pure-white);
  padding: 12px 22px;
  border-radius: var(--radius-tags);
  font-size: 14px;
  font-weight: 600;
  z-index: 95;
  display: none;
}

/* RESPONSIVE <= 960px & 390px MOBILE */
@media (max-width: 960px) {
  .login-split {
    grid-template-columns: 1fr;
  }
  .login-feature-pills {
    grid-template-columns: 1fr;
  }
  .studio-shell.active {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    left: -290px;
    top: 0;
    width: 276px;
    z-index: 60;
    transition: left 0.2s ease;
  }
  .sidebar.open {
    left: 0;
  }
  .drawer-overlay.open {
    display: block;
  }
  .mobile-topbar {
    display: flex;
  }
  .mobile-bottom-nav {
    display: grid;
  }
  .workspace-wrap {
    padding: 20px 16px 96px;
  }
  .metrics-4,
  .grid-2,
  .grid-3,
  .wizard-steps,
  .preset-grid,
  .preview-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .login-hero-block,
  .login-form-block,
  .blueprint-card,
  .white-card,
  .midnight-card,
  .cv-paper {
    padding: 20px;
  }
  .toast-banner {
    left: 16px;
    right: 16px;
    bottom: 74px;
    text-align: center;
  }
}
