/* sign-pdf.css – modern, card‑based, fully responsive */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f6f8fb;
  color: #1e293b;
  line-height: 1.5;
  padding: 24px 20px;
}

.app-wrapper {
  max-width: 1400px;
  margin: 0 auto;
}

/* cards & shadows */
.card {
  background: white;
  border-radius: 24px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.02), 0 2px 6px rgba(0, 20, 40, 0.04);
  padding: 28px 24px;
  transition: box-shadow 0.2s;
  border: 1px solid rgba(255,255,255,0.5);
  backdrop-filter: blur(4px);
}

.upload-card {
  margin-bottom: 24px;
  padding: 16px;
}

.app-header {
  margin-bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
}

.app-header h1 {
  font-weight: 600;
  font-size: 1.8rem;
  letter-spacing: -0.01em;
  color: #0f2b3d;
}

.trust-badge {
  background: #eef2ff;
  border-radius: 40px;
  padding: 8px 18px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #1e3a5f;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.6);
}

/* DROP ZONE */
.drop-zone {
  border: 2px dashed #cbd5e1;
  border-radius: 20px;
  background: #fafcff;
  padding: 32px 20px;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}

.drop-zone:hover {
  border-color: #3b82f6;
  background: #f5f9ff;
}

.drop-content .upload-icon {
  font-size: 3.4rem;
  display: block;
  margin-bottom: 12px;
}

.drop-text {
  font-size: 1.1rem;
  margin-bottom: 20px;
  color: #475569;
}

.hidden-input {
  position: absolute;
  opacity: 0;
  width: 0.1px;
  height: 0.1px;
  pointer-events: none;
}

.button {
  display: inline-block;
  background: white;
  border: 1px solid #cbd5e1;
  padding: 10px 24px;
  border-radius: 40px;
  font-weight: 500;
  font-size: 0.95rem;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.button-primary {
  background: #2563eb;
  border-color: #2563eb;
  color: white;
}

.button-primary:hover {
  background: #1d4ed8;
}

.button.small {
  padding: 6px 18px;
  font-size: 0.85rem;
}

.button.secondary {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.button-apply {
  background: #0f2b3d;
  border-color: #0f2b3d;
  color: white;
  font-weight: 600;
  width: 100%;
  margin-top: 8px;
  padding: 12px;
}

.button-reset {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
  margin-top: 12px;
  width: 100%;
}

/* file info */
.file-info {
  margin-top: 16px;
  padding: 10px 16px;
  background: #e6f7e6;
  border-radius: 100px;
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 500;
}

.hidden {
  display: none !important;
}

/* WORKSPACE GRID */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 28px;
  margin-top: 8px;
}

@media (max-width: 900px) {
  .main-grid { grid-template-columns: 1fr; }
}

.signature-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* TABS */
.tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid #e9edf2;
  padding-bottom: 12px;
}

.tab-btn {
  background: transparent;
  border: none;
  padding: 10px 18px;
  border-radius: 40px;
  font-weight: 500;
  color: #64748b;
  cursor: pointer;
  transition: 0.1s;
}

.tab-btn.active {
  background: #e6edfb;
  color: #1e40af;
  font-weight: 600;
}

.tab-pane {
  display: none;
  margin-top: 16px;
}

.tab-pane.active {
  display: block;
}

/* DRAW canvas */
.signature-draw-area {
  border: 1px solid #d1d9e6;
  border-radius: 16px;
  background: white;
  width: 100%;
  height: auto;
  touch-action: none;
}

.draw-toolbar {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

/* type / upload previews */
.type-input, .font-select {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #ccd7e4;
  font-size: 0.95rem;
  width: 100%;
  margin-bottom: 12px;
}

.font-select {
  background: white;
}

.type-preview-canvas, .upload-preview-canvas {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid #e1e8f0;
  margin-top: 8px;
  background: white;
}

/* signature thumbnail */
.signature-thumb {
  min-height: 70px;
  background: #f8fafc;
  border-radius: 16px;
  border: 1px dashed #b9c8da;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  margin: 12px 0;
}

.placeholder {
  color: #94a3b8;
  font-style: italic;
}

/* PDF preview */
.pdf-wrapper {
  background: #e9ecf0;
  border-radius: 20px;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.02);
  margin-top: 16px;
  border: 1px solid #dde3ea;
}

.pdf-canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

.signature-overlay {
  border: 2px solid rgba(37, 99, 235, 0.5);
  border-radius: 8px;
  background: rgba(255,255,255,0.2);
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  top: 20%;
  left: 20%;
  width: 120px;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.signature-overlay.dragging {
  cursor: grabbing;
  opacity: 0.85;
  border-color: #2563eb;
}

.signature-overlay img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

/* resize slider */
.resize-control {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 8px 0;
}

.label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #33475b;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.page-dropdown {
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid #ccd7e4;
  background: white;
  width: 100%;
}

/* error toast */
.error-toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #d32f2f;
  color: white;
  padding: 14px 28px;
  border-radius: 50px;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(211,47,47,0.2);
  max-width: 400px;
  z-index: 999;
}

/* misc */
.hint {
  font-size: 0.8rem;
  color: #62748b;
  margin-top: 8px;
}

.divider {
  margin: 18px 0;
  border: 0;
  border-top: 1px solid #ecf1f6;
}

.pdf-metadata {
  font-size: 0.9rem;
  font-weight: 500;
  color: #1e3a5f;
}

/* mobile fine-tuning */
@media (max-width: 600px) {
  body { padding: 16px; }
  .card { padding: 20px; }
  .app-header h1 { font-size: 1.4rem; }
}