/* Axios DocStudio Styles */
:root {
  --bg-primary: #070a12;
  --bg-surface: #0f172a;
  --bg-surface-elevated: #1e293b;
  --bg-paper: #ffffff;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --accent-cyan: #38bdf8;
  --accent-blue: #0284c7;
  --accent-indigo: #6366f1;
  --accent-emerald: #10b981;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.15);
  --font-sans: 'Plus Jakarta Sans', -apple-system, sans-serif;
  --font-heading: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg-primary);
  color: var(--text-main);
  font-family: var(--font-sans);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* Header */
.studio-header {
  height: 60px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1.25rem;
  z-index: 100;
}

.header-left, .header-center, .header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: inherit;
}

.brand-logo {
  height: 32px;
  width: auto;
  filter: drop-shadow(0 2px 8px rgba(56, 189, 248, 0.5));
}

.brand-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
  letter-spacing: -0.02em;
  display: block;
}

.brand-sub {
  font-size: 0.65rem;
  color: var(--accent-cyan);
  font-weight: 600;
  display: block;
}

.doc-selector-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: 1rem;
  background: rgba(30, 41, 59, 0.6);
  padding: 0.25rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
}

.header-select {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  outline: none;
  cursor: pointer;
}

.header-select option {
  background: #0f172a;
  color: #fff;
}

.zoom-controls, .page-controls {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.2rem 0.4rem;
}

.btn-tool {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}

.btn-tool:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.zoom-text, .page-text {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #fff;
  min-width: 44px;
  text-align: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-indigo));
  color: #fff;
  box-shadow: 0 4px 15px rgba(2, 132, 199, 0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.5);
}

.btn-secondary {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border-medium);
  color: #e2e8f0;
}

.btn-secondary:hover {
  background: rgba(51, 65, 85, 0.9);
  color: #fff;
}

.btn-auth-user {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #fff;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}

.auth-dot {
  width: 7px;
  height: 7px;
  background: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
}

.btn-ecosystem-link {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: var(--accent-cyan);
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
}

.btn-signout {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

/* Studio Main Layout */
.studio-main {
  display: grid;
  grid-template-columns: 260px 1fr 300px;
  flex: 1;
  overflow: hidden;
}

.sidebar-left, .sidebar-right {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(12px);
  border-right: 1px solid var(--border-subtle);
  padding: 1rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sidebar-right {
  border-right: none;
  border-left: 1px solid var(--border-subtle);
}

.sidebar-section-title {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-cyan);
}

.elements-palette {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.palette-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  color: #fff;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.palette-item:hover {
  background: rgba(51, 65, 85, 0.8);
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-1px);
}

.palette-icon {
  font-size: 1.25rem;
}

.palette-item strong {
  display: block;
  font-size: 0.82rem;
  color: #fff;
}

.palette-item span {
  display: block;
  font-size: 0.7rem;
  color: #94a3b8;
}

.compliance-card {
  margin-top: auto;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 12px;
  padding: 0.85rem;
}

.compliance-badge {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
}

.compliance-body {
  font-size: 0.75rem;
  margin-top: 0.5rem;
  color: #e2e8f0;
}

.compliance-body code {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--accent-cyan);
  display: block;
  margin-top: 2px;
}

/* Canvas Viewport */
.canvas-viewport {
  background: #020617;
  overflow: auto;
  display: flex;
  justify-content: center;
  padding: 2rem;
  position: relative;
}

.canvas-paper {
  width: 792px; /* 8.5in at 93.18dpi or standard US Letter */
  min-height: 1024px; /* 11in */
  background: var(--bg-paper);
  color: #0f172a;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(56, 189, 248, 0.15);
  border-radius: 4px;
  padding: 48px;
  position: relative;
  font-family: 'Times New Roman', serif;
  line-height: 1.5;
  transition: transform 0.2s ease;
  transform-origin: top center;
}

.paper-footer-seal {
  position: absolute;
  bottom: 20px;
  left: 48px;
  right: 48px;
  border-top: 1px solid #cbd5e1;
  padding-top: 8px;
  font-size: 0.68rem;
  font-family: var(--font-mono);
  color: #64748b;
  text-align: center;
}

/* Canvas Elements */
.doc-canvas-header {
  border-bottom: 2px solid #0f172a;
  padding-bottom: 12px;
  margin-bottom: 24px;
  text-align: center;
}

.doc-canvas-header h1 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.doc-canvas-header .sub {
  font-size: 0.82rem;
  color: #475569;
  margin-top: 4px;
}

.doc-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
  font-size: 0.85rem;
}

.doc-clause-block {
  background: #f8fafc;
  border-left: 3px solid #0284c7;
  padding: 8px 12px;
  margin-bottom: 14px;
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.doc-sig-block {
  margin-top: 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.sig-box {
  border-top: 1px solid #0f172a;
  padding-top: 8px;
}

.sig-script-name {
  font-family: 'Caveat', cursive;
  font-size: 1.8rem;
  color: #0369a1;
  height: 48px;
  display: flex;
  align-items: flex-end;
}

.sig-digital-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: #059669;
  font-weight: 700;
  display: block;
  margin-top: 2px;
}

/* Inspector */
.inspector-card {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 0.85rem;
}

.inspector-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #cbd5e1;
  margin-bottom: 0.4rem;
}

.inspector-select {
  width: 100%;
  background: #0f172a;
  border: 1px solid var(--border-medium);
  color: #fff;
  padding: 0.5rem;
  border-radius: 6px;
  font-size: 0.8rem;
  outline: none;
}

.sig-styles-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.sig-style-btn {
  background: #0f172a;
  border: 1px solid var(--border-subtle);
  padding: 0.5rem;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  text-align: center;
}

.sig-style-btn.active {
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.1);
}

.security-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-card {
  background: #0f172a;
  border: 1px solid var(--border-medium);
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  padding: 1.5rem;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.8);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.modal-header h3 {
  font-size: 1.1rem;
  color: #fff;
}

.btn-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.2rem;
  cursor: pointer;
}

.sig-canvas {
  background: #fff;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  display: block;
  margin: 0 auto;
  cursor: crosshair;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1rem;
}
