/* Intake paperwork, the loose Hippocratic Oath, combination boxes, memos. */

.intake-stage {
  position: absolute;
  inset: 0;
  display: grid;
  justify-items: center;
  align-items: start;
  overflow: auto;
  padding: clamp(104px, 17vh, 190px) 16px 60px;
  opacity: 0;
  transform: translateY(40px) rotate(-1deg);
  transition: opacity 0.5s ease, transform 0.7s cubic-bezier(.2, .8, .25, 1);
}
.intake-stage.in { opacity: 1; transform: none; }
.intake-stage.out { opacity: 0; transform: translate3d(0, 30vh, 0) rotate(3deg) scale(0.9); transition-duration: 0.6s; }

.intake-page {
  width: min(820px, 100%);
  padding: clamp(24px, 4vw, 56px) clamp(20px, 5vw, 64px) 40px;
  border-radius: 2px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.5);
}
.letterhead {
  text-align: center;
  border-bottom: 3px double rgba(30, 25, 20, 0.7);
  padding-bottom: 14px;
  margin-bottom: 26px;
}
.lh-title { font-family: var(--font-deco); font-size: clamp(1.4rem, 3vw, 2.3rem); letter-spacing: 0.04em; }
.lh-sub { font-family: var(--font-type); font-size: 0.78rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--ink-soft); margin-top: 4px; }
.lh-form { margin-top: 10px; font-size: 1rem; letter-spacing: 0.12em; text-transform: uppercase; }

.intake-sec { margin: 0 0 30px; }
.sec-title {
  font-family: var(--font-type);
  font-weight: 400;
  font-size: 1.05rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 14px;
  border-bottom: 1px solid rgba(30, 25, 20, 0.35);
  padding-bottom: 4px;
}
.sec-title .roman { color: var(--ink-red); margin-right: 4px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px 28px; }
.typed-value { font-family: var(--font-type); font-size: 1.15rem; padding: 4px 4px 2px; border-bottom: 1.5px solid rgba(40, 30, 20, 0.45); }

.dob-row { display: flex; align-items: baseline; gap: 6px; }
.dob-row .line-input { width: 3ch; text-align: center; padding: 2px 0 0; }
.dob-row .yyyy { width: 4.6ch; }
.dob-row .sep { font-family: var(--font-hand); font-size: 1.6rem; color: var(--graphite); }

.letter { font-family: var(--font-body); font-size: 0.98rem; line-height: 1.6; }
.letter ol { padding-left: 1.4em; }
.letter li { margin: 0 0 6px; }
.agree-line { display: flex; gap: 10px; align-items: center; margin: 16px 0 10px; font-family: var(--font-type); cursor: pointer; }
.agree-line input { width: 20px; height: 20px; accent-color: var(--ink-blue); }

.sig-block { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 28px; margin-top: 10px; }
.sig-pad {
  position: relative;
  flex: 1 1 340px;
  height: 130px;
  border-bottom: 2px solid rgba(30, 25, 20, 0.7);
  background: linear-gradient(180deg, transparent 70%, rgba(40, 60, 120, 0.04));
}
.sig-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='34' viewBox='0 0 34 34'%3E%3Cpath d='M2 32 L6 22 L26 2 L32 8 L12 28 Z' fill='%23111' stroke='%23d9b862' stroke-width='1.2'/%3E%3Cpath d='M2 32 L6 22 L12 28 Z' fill='%23d9b862'/%3E%3C/svg%3E") 2 32, crosshair;
}
.sig-typed { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0; transition: opacity 0.2s; }
.sig-pad.typing .sig-typed { opacity: 1; }
.sig-pad.typing .sig-canvas { opacity: 0; pointer-events: none; }
.sig-modes { display: flex; gap: 4px; margin: 14px 0 4px; }
.sig-mode {
  border: 0;
  background: none;
  padding: 6px 12px 4px;
  font-family: var(--font-type);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 2px solid transparent;
  cursor: pointer;
}
.sig-mode.on { color: var(--ink); border-bottom-color: var(--ink-red); }
.sig-typerow { max-width: 360px; margin: 6px 0 4px; }
.sig-x { position: absolute; left: 4px; bottom: 6px; font-size: 1.1rem; color: var(--ink-soft); pointer-events: none; }
.sig-hint { position: absolute; left: 28px; bottom: 8px; font-family: var(--font-hand); font-size: 1.3rem; color: rgba(40, 30, 20, 0.35); pointer-events: none; transition: opacity 0.3s; }
.sig-pad.signed .sig-hint { opacity: 0; }
.sig-meta { display: grid; gap: 4px; }

.note-line { font-family: var(--font-body); font-size: 0.95rem; margin: 0 0 12px; }
.code-pair { display: flex; flex-wrap: wrap; gap: 18px 40px; }
.code-boxes { display: flex; align-items: center; gap: 6px; }
.code-box {
  width: 2.1rem;
  height: 2.7rem;
  text-align: center;
  font-family: var(--font-hand);
  font-size: 1.9rem;
  color: var(--graphite);
  background: rgba(255, 255, 255, 0.18);
  border: 1.5px solid rgba(40, 30, 20, 0.55);
  border-radius: 2px;
  outline: none;
  caret-color: transparent;
}
.code-box:focus { border-color: var(--ink-blue); background: rgba(255, 255, 255, 0.35); box-shadow: 0 0 0 2px rgba(31, 47, 85, 0.2); }
.code-dash { font-family: var(--font-hand); font-size: 1.6rem; color: var(--ink-soft); }

.form-error { color: var(--ink-red); min-height: 1.4em; margin: 8px 0; font-size: 1.4rem; }
.intake-actions { display: flex; justify-content: flex-end; margin-top: 10px; }
.intake-actions .btn { font-size: 1.05rem; padding: 0.7em 1.4em; }

.filed-stamp {
  position: absolute;
  right: 12%;
  top: 40%;
  font-size: clamp(2.4rem, 7vw, 5rem);
  pointer-events: none;
  animation: stamp-slam 0.35s cubic-bezier(.2, 1.6, .4, 1) both;
}
@keyframes stamp-slam { from { transform: scale(2.2) rotate(-14deg); opacity: 0; } to { transform: rotate(-12deg); opacity: 0.85; } }

/* ---------- The Oath, loose on the desk ---------- */

.oath {
  position: fixed;
  z-index: 6;
  right: 2.5vw;
  top: 20vh;
  width: clamp(240px, 19vw, 330px);
  max-height: 70vh;
  overflow: hidden;
  padding: 18px 18px 22px;
  font-family: var(--font-old);
  font-size: 0.74rem;
  line-height: 1.42;
  color: #2a2117;
  background-color: #dccfa9;
  transform: rotate(4deg);
  cursor: grab;
  user-select: none;
  touch-action: none;
  transition: box-shadow 0.2s, transform 0.2s, opacity 0.5s;
  animation: oath-in 0.8s 0.4s cubic-bezier(.2, .8, .25, 1) both;
}
.oath::after { /* foxing, page curl shadow */
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 85% 12%, rgba(130, 80, 30, 0.18), transparent 25%),
    radial-gradient(circle at 10% 90%, rgba(130, 80, 30, 0.15), transparent 30%),
    linear-gradient(135deg, transparent 88%, rgba(0, 0, 0, 0.12));
  pointer-events: none;
}
.oath.lifted { cursor: grabbing; transform: rotate(1deg) scale(1.03); box-shadow: 0 30px 50px rgba(0, 0, 0, 0.55); }
.oath.out { opacity: 0; }
.oath h3 { font-family: var(--font-old); font-weight: 400; font-size: 1.15rem; text-align: center; margin: 0; letter-spacing: 0.04em; }
.oath .oath-sub { text-align: center; font-style: italic; margin: 2px 0 10px; font-size: 0.68rem; }
.oath p { margin: 0 0 7px; text-align: justify; hyphens: auto; }
.oath p:first-of-type::first-letter { font-size: 2.2em; float: left; line-height: 0.9; margin: 2px 4px 0 0; }
.oath-grip { position: absolute; top: 6px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: rgba(60, 45, 25, 0.25); }
@keyframes oath-in { from { opacity: 0; transform: translate(30vw, 10vh) rotate(25deg); } to { opacity: 1; transform: rotate(4deg); } }

/* ---------- Memos (dialogs) ---------- */

.memo-wrap {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(5, 6, 8, 0.55);
  backdrop-filter: blur(2px);
  animation: fade-in 0.2s ease both;
}
.memo-wrap.out { animation: fade-out 0.2s ease both; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
.memo {
  width: min(520px, 100%);
  max-height: 88vh;
  overflow: auto;
  padding: 18px 26px 22px;
  animation: memo-in 0.35s cubic-bezier(.2, .9, .3, 1.15) both;
  outline: none;
}
.memo.wide { width: min(860px, 100%); }
@keyframes memo-in { from { transform: translateY(30px) rotate(2deg) scale(0.96); opacity: 0; } }
.memo-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid rgba(30, 25, 20, 0.6); padding-bottom: 6px; letter-spacing: 0.3em; font-size: 0.8rem; }
.memo-x { border: 0; background: none; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--ink-soft); }
.memo-title { font-weight: 400; font-size: 1.3rem; margin: 14px 0 8px; letter-spacing: 0.06em; }
.memo-body { font-family: var(--font-body); font-size: 0.98rem; line-height: 1.5; }
.memo-body .field { margin-bottom: 14px; }
.memo-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

@media (max-width: 860px) {
  .oath { right: auto; left: 8px; top: auto; bottom: 90px; width: 70vw; max-height: 34vh; }
  .intake-stage { padding-top: 64px; padding-bottom: 110px; }
}
