﻿:root {
  --bg: #eef5f7;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-strong: #ffffff;
  --ink: #2f3b44;
  --ink-soft: #60717f;
  --accent: #00b3d2;
  --accent-soft: #dff6fb;
  --ok: #0091b0;
  --line: rgba(47, 59, 68, 0.18);
  --shadow: 0 18px 45px rgba(25, 43, 53, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 14% 18%, #dff6fb 0%, transparent 34%), radial-gradient(circle at 82% 10%, #e7edf0 0%, transparent 36%), var(--bg);
}

.ambient {
  position: fixed;
  z-index: -1;
  filter: blur(16px);
  opacity: 0.55;
}

.ambient-one {
  inset: auto auto 8% 6%;
  width: 280px;
  height: 280px;
  border-radius: 36% 64% 43% 57% / 48% 38% 62% 52%;
  background: linear-gradient(140deg, #bdeef8, #dbf6fc);
}

.ambient-two {
  inset: 4% 6% auto auto;
  width: 260px;
  height: 240px;
  border-radius: 60% 40% 59% 41% / 38% 51% 49% 62%;
  background: linear-gradient(140deg, #d8e4ea, #eef5f8);
}

.notice-host {
  position: fixed;
  right: 18px;
  top: 18px;
  z-index: 1200;
  display: grid;
  gap: 10px;
  width: min(420px, 92vw);
}

.notice {
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(25, 43, 53, 0.16);
  padding: 10px 12px;
  animation: noticeIn 240ms ease;
}

.notice-title {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 3px;
}

.notice-body {
  font-size: 13px;
  color: var(--ink-soft);
  white-space: pre-line;
}

.notice.error {
  border-color: rgba(199, 55, 44, 0.42);
  background: #fff4f2;
}

.notice.error .notice-title {
  color: #b33228;
}

.notice.warn {
  border-color: rgba(176, 125, 18, 0.4);
  background: #fff9ed;
}

.notice.warn .notice-title {
  color: #9c6d08;
}

.notice.info {
  border-color: rgba(0, 179, 210, 0.42);
  background: #eefbfe;
}

.notice.info .notice-title {
  color: #007f99;
}

@keyframes noticeIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.app-shell {
  width: min(1600px, 96vw);
  margin: 24px auto;
  display: grid;
  grid-template-columns: minmax(350px, 420px) 1fr;
  gap: 18px;
  align-items: start;
}

.app-footer {
  width: min(1600px, 96vw);
  margin: 0 auto 16px;
  padding: 10px 16px 2px;
  color: #5f7480;
  font-size: 12px;
  text-align: center;
}

.card {
  background: var(--surface);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.left-panel {
  padding: 24px;
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  background: #f3f8fa;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  gap: 4px;
}

.lang-btn {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 6px 11px;
  cursor: pointer;
}

.lang-btn.active {
  background: #00b3d2;
  color: #fff;
  box-shadow: 0 4px 10px rgba(0, 126, 148, 0.28);
}

.brand-logo {
  width: 210px;
  max-width: 100%;
  margin-bottom: 8px;
}

.eyebrow {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--ink-soft);
}

h1,
h2,
h3 {
  margin: 8px 0;
  font-family: "Montserrat", "Manrope", "Segoe UI", sans-serif;
  font-weight: 700;
  line-height: 1.08;
}

h1 {
  font-size: clamp(30px, 3.2vw, 42px);
}

h2 {
  font-size: clamp(21px, 2vw, 30px);
}

.subtitle {
  margin: 10px 0 0;
  color: var(--ink-soft);
}

.stepper {
  list-style: none;
  padding: 0;
  margin: 22px 0;
  display: grid;
  gap: 10px;
}

.stepper li {
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 10px 12px;
  font-size: 14px;
  color: var(--ink-soft);
  transition: all 220ms ease;
}

.stepper li.active {
  border-color: var(--accent);
  background: linear-gradient(110deg, #e8f8fc, #ffffff);
  color: var(--ink);
  transform: translateX(3px);
}

.stepper li.done {
  border-color: rgba(0, 179, 210, 0.35);
  background: #eefbfe;
}

.step-content {
  animation: revealUp 360ms ease;
}

@keyframes revealUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.form-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
}

input,
textarea,
button {
  font-family: inherit;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 12px;
  background: #fffdfa;
  color: var(--ink);
}

.field textarea {
  min-height: 88px;
  resize: vertical;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.primary-btn,
.ghost-btn {
  border-radius: 12px;
  border: 1px solid transparent;
  padding: 10px 14px;
  cursor: pointer;
  transition: all 180ms ease;
  font-weight: 600;
}

.primary-btn {
  background: var(--accent);
  color: #ffffff;
}

.primary-btn:hover {
  background: #0091b0;
}

.ghost-btn {
  background: #fffcf9;
  border-color: var(--line);
  color: var(--ink);
}

.ghost-btn:hover {
  border-color: var(--accent);
  color: #006b82;
}

.footer-note {
  margin-top: 18px;
  padding: 10px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  font-size: 13px;
  color: var(--ink-soft);
}

.status-message {
  min-height: 20px;
  margin: 10px 0 0;
  font-size: 13px;
  color: #0e6e52;
}

.viewer-panel {
  padding: 18px;
}

.viewer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.placement-hint {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(0, 179, 210, 0.45);
  background: #eefbfe;
  border-radius: 12px;
  font-size: 13px;
  color: #1f5966;
}

.placement-actions {
  display: flex;
  gap: 8px;
}

.pdf-container {
  height: calc(100vh - 130px);
  overflow: auto;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #e7f0f3, #f6fbfd);
  padding: 14px;
}

.page-wrap {
  position: relative;
  width: fit-content;
  margin: 0 auto 14px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.16);
  transform-origin: center top;
  animation: revealUp 350ms ease;
}

.page-wrap canvas {
  display: block;
  background: white;
}

.page-wrap.placement-mode {
  cursor: crosshair;
  box-shadow: 0 0 0 3px rgba(0, 179, 210, 0.25), 0 10px 20px rgba(0, 0, 0, 0.16);
}

.placement-ghost {
  position: absolute;
  border: 1px dashed rgba(0, 179, 210, 0.7);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.85);
  pointer-events: none;
  display: none;
  overflow: hidden;
}

.placement-ghost img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  opacity: 0.82;
}

.placement-pointer {
  position: absolute;
  pointer-events: none;
  display: none;
  transform: translate(-50%, -120%);
  z-index: 4;
}

.placement-pointer-dot {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #00b3d2;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 0 rgba(0, 179, 210, 0.55);
  margin: 0 auto;
  animation: placementPulse 1.1s infinite;
}

.placement-pointer-label {
  margin-top: 6px;
  background: rgba(0, 179, 210, 0.94);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
  box-shadow: 0 6px 14px rgba(0, 94, 112, 0.35);
}

@keyframes placementPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 179, 210, 0.55);
  }
  100% {
    box-shadow: 0 0 0 14px rgba(0, 179, 210, 0);
  }
}

.overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.overlay-item {
  position: absolute;
  pointer-events: auto;
}

.overlay-item input,
.overlay-item textarea {
  width: 100%;
  height: 100%;
  border: 1px solid rgba(27, 61, 66, 0.18);
  border-radius: 4px;
  background: #eceef0;
  padding: 2px 6px;
  font-size: 13px;
}

.overlay-item textarea {
  resize: none;
}

.signature-box {
  border: 2px dashed rgba(27, 61, 66, 0.36);
  border-radius: 7px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0;
  line-height: 1;
  overflow: hidden;
  cursor: pointer;
}

.signature-box.has-signature {
  border: 0;
  background: transparent;
}

.signature-box.flash {
  animation: sigFlash 680ms ease;
}

@keyframes sigFlash {
  0% {
    box-shadow: 0 0 0 0 rgba(24, 138, 101, 0.35);
  }
  100% {
    box-shadow: 0 0 0 16px rgba(24, 138, 101, 0);
  }
}

.signature-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.signature-preview {
  width: 100%;
  max-width: 220px;
  height: 62px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.doc-stamp {
  border: 2px solid rgba(27, 61, 66, 0.5);
  background: rgba(229, 247, 240, 0.96);
  border-radius: 6px;
  color: #0d6f52;
  font-size: 11px;
  line-height: 1.2;
  padding: 6px;
}

.text-mask {
  position: absolute;
  background: rgba(255, 255, 255, 0.99);
  border-radius: 2px;
  pointer-events: none;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  background: #fff;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #b3b3b3;
}

.status-dot.ok {
  background: var(--ok);
}

.dialog {
  border: 0;
  padding: 0;
  border-radius: 18px;
  box-shadow: var(--shadow);
  width: min(640px, 92vw);
}

.dialog::backdrop {
  background: rgba(16, 26, 29, 0.48);
}

.dialog-card {
  padding: 20px;
  background: #fffdf8;
}

.dialog-card p {
  color: var(--ink-soft);
}

#signatureCanvas {
  width: 100%;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: #fff;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.smartid-card {
  text-align: center;
}

.challenge {
  font-family: "Fraunces", Georgia, serif;
  font-size: 44px;
  letter-spacing: 0.18em;
  margin: 8px 0;
  color: var(--accent);
}

.tiny {
  font-size: 12px;
}

.completion {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(24, 138, 101, 0.32);
  background: #f1fcf7;
  font-size: 14px;
}

@media (max-width: 1100px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .left-panel {
    position: static;
    max-height: none;
  }

  .pdf-container {
    height: 72vh;
  }
}
