/* Sign page styles — allow full-page scroll with long PDF + form (style.css fixes html/body height) */
html {
  height: auto;
  min-height: 100%;
}
body {
  min-height: 100%;
  height: auto;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.view { display: none; min-height: 100vh; padding: 1rem; }
.view.active { display: flex; align-items: flex-start; justify-content: center; padding-top: 2rem; }

.sign-card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 16px;
  padding: 2rem 1.5rem;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 4px 32px rgba(0,0,0,0.4);
}

.sign-card--wide { max-width: 960px; }

.brand {
  font-size: 1.25rem;
  font-weight: 800;
  color: #6366f1;
  letter-spacing: -0.5px;
  margin-bottom: 1.25rem;
}

.sign-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.4rem;
  color: #f8fafc;
}

.sign-card p, .subtitle {
  color: #94a3b8;
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0 0 1rem;
}

/* Loader */
.loader {
  width: 40px; height: 40px;
  border: 3px solid #334155;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 1.5rem auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Icons */
.success-icon, .error-icon {
  font-size: 3rem;
  text-align: center;
  margin: 0.75rem 0 1rem;
}

/* Full PDF preview (before signature) */
.contract-pdf-block {
  margin: 1rem 0 1.25rem;
}

.contract-pdf-heading {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  color: #f8fafc;
}

.contract-pdf-hint {
  font-size: 0.82rem;
  color: #94a3b8;
  margin: 0 0 0.75rem;
  line-height: 1.5;
}

.contract-pdf-frame-wrap {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 10px;
  overflow: hidden;
  min-height: 420px;
}

.contract-pdf-frame {
  display: block;
  width: 100%;
  min-height: 55vh;
  max-height: 70vh;
  border: none;
  background: #fff;
}

.contract-pdf-link {
  display: inline-block;
  margin-top: 0.65rem;
  font-size: 0.875rem;
  color: #818cf8;
  text-decoration: none;
  font-weight: 600;
}

.contract-pdf-link:hover {
  text-decoration: underline;
  color: #a5b4fc;
}

/* Contract summary */
.contract-summary {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 0.75rem;
  margin: 1rem 0 1.5rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.45rem 0.25rem;
  border-bottom: 1px solid #1e293b;
  gap: 1rem;
  font-size: 0.875rem;
}

.summary-row:last-child { border-bottom: none; }

.summary-label {
  color: #64748b;
  min-width: 130px;
  flex-shrink: 0;
}

.summary-value {
  color: #e2e8f0;
  font-weight: 500;
  text-align: right;
}

/* Signature section */
.signature-section {
  border-top: 1px solid #334155;
  padding-top: 1.5rem;
  margin-top: 0.5rem;
}

.signature-section h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: #f8fafc;
}

.sign-info {
  font-size: 0.82rem;
  color: #64748b;
  line-height: 1.6;
  margin-bottom: 1.25rem;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 0.75rem;
}

/* Form */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 0.4rem;
}

.form-group input {
  width: 100%;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  color: #f1f5f9;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}

.required { color: #f87171; }

/* Checkbox */
.checkbox-label {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  font-size: 0.875rem;
  color: #94a3b8;
  line-height: 1.5;
  margin-bottom: 1.25rem;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 18px; height: 18px;
  min-width: 18px;
  margin-top: 1px;
  accent-color: #6366f1;
  cursor: pointer;
}

/* Sign button */
.btn-sign {
  width: 100%;
  background: #4f46e5;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 1rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  letter-spacing: 0.3px;
}

.btn-sign:hover:not(:disabled) { background: #4338ca; }
.btn-sign:active:not(:disabled) { transform: scale(0.98); }
.btn-sign:disabled { background: #475569; cursor: not-allowed; }

/* Error */
.sign-error {
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.4);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: #f87171;
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

/* Signed info box */
.signed-info {
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.3);
  border-radius: 10px;
  padding: 0.75rem;
  margin: 1rem 0;
}

.signed-info .summary-row {
  border-bottom-color: rgba(16,185,129,0.1);
}

.signed-info .summary-label { color: #6ee7b7; }
.signed-info .summary-value { color: #d1fae5; }

/* Legal note */
.sign-legal {
  font-size: 0.75rem;
  color: #475569;
  text-align: center;
  margin-top: 1.5rem;
  line-height: 1.6;
}
