/* =============================================
   Dermagal — Shared Styles
   iPad-first, spa aesthetic
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@300;400;500;600&family=Lato:wght@300;400;700&display=swap');

:root {
  --primary:       #C07882;
  --primary-dark:  #A5606A;
  --primary-light: rgba(192, 120, 130, 0.08);
  --background:    #F0F5F3;
  --page-bg:       #C8D9D2;
  --surface:       #FFFFFF;
  --text:          #2C2420;
  --text-medium:   #6B5D56;
  --text-light:    #A89990;
  --border:        #EDE5DC;
  --success:       #7BA08B;
  --danger:        #C47070;
  --shadow:        0 2px 20px rgba(44, 36, 32, 0.07);
  --radius:        12px;
  --font-heading:  'Cormorant Garamond', Georgia, serif;
  --font-body:     'Lato', system-ui, sans-serif;
}

/* ---- Reset ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  font-family: var(--font-body);
  background: var(--page-bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

/* ---- App Shell ---- */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-width: 800px;
  margin: 0 auto;
  background: var(--surface);
  box-shadow: var(--shadow);
}

/* ---- Header ---- */
.app-header {
  flex-shrink: 0;
  padding: 16px 24px 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.brand {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 500;
  color: var(--primary);
  letter-spacing: 0.06em;
  text-decoration: none;
}

.step-label {
  font-size: 12px;
  color: var(--text-light);
  font-weight: 400;
  letter-spacing: 0.02em;
}

.progress-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
  transition: width 0.35s ease;
  width: 0%;
}

/* ---- Steps ---- */
.steps-container {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.step {
  display: none;
  padding: 32px 24px 24px;
  min-height: 100%;
  animation: stepIn 0.22s ease;
}

.step.active { display: block; }

@keyframes stepIn {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ---- Typography ---- */
.step-title {
  font-family: var(--font-heading);
  font-size: 30px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.15;
}

.step-subtitle {
  font-size: 15px;
  color: var(--text-light);
  margin-bottom: 28px;
  line-height: 1.65;
}

/* ---- Form Fields ---- */
.field-group { margin-bottom: 20px; }

.field-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-medium);
  margin-bottom: 8px;
}

.required { color: var(--primary); margin-left: 2px; }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="time"],
input[type="number"],
textarea,
select {
  width: 100%;
  height: 54px;
  padding: 0 16px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text);
  background: var(--background);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

textarea {
  height: 110px;
  padding: 14px 16px;
  resize: none;
  line-height: 1.55;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  background: var(--surface);
}

input[readonly] {
  color: var(--text-light);
  cursor: default;
}

.field-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row-3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; }

/* ---- YES / NO Toggles ---- */
.yn-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.yn-group:last-of-type { border-bottom: none; }

.yn-label {
  font-size: 16px;
  color: var(--text);
  flex: 1;
  padding-right: 16px;
  line-height: 1.4;
}

.yn-buttons { display: flex; gap: 8px; flex-shrink: 0; }

.yn-btn {
  width: 68px;
  height: 44px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  background: var(--surface);
  color: var(--text-light);
  transition: all 0.15s;
}

.yn-btn.yes.selected { background: var(--primary);  border-color: var(--primary);  color: #fff; }
.yn-btn.no.selected  { background: var(--danger);   border-color: var(--danger);   color: #fff; }

/* ---- Multi-select Chips ---- */
.chips-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.chip {
  padding: 16px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: var(--font-body);
  color: var(--text-medium);
  background: var(--surface);
  cursor: pointer;
  text-align: center;
  line-height: 1.3;
  transition: all 0.15s;
  user-select: none;
}

.chip.selected {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ---- Radio Options ---- */
.radio-group { display: flex; flex-direction: column; gap: 10px; }

.radio-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}

.radio-option.selected {
  border-color: var(--primary);
  background: var(--primary-light);
}

.radio-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.radio-option.selected .radio-dot {
  border-color: var(--primary);
  background: var(--primary);
}

.radio-option.selected .radio-dot::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
}

.radio-text { font-size: 16px; color: var(--text); }

/* ---- Waiver Items ---- */
.waiver-item {
  margin-bottom: 16px;
  padding: 16px;
  background: var(--background);
  border-radius: 10px;
  border-left: 3px solid var(--border);
}

.waiver-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.65;
  margin-bottom: 12px;
}

.initial-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.initial-input {
  width: 80px !important;
  height: 48px !important;
  text-align: center !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  flex-shrink: 0;
}

.initial-label { font-size: 13px; color: var(--text-light); }

/* ---- Signature Canvas ---- */
.signature-wrap {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--background);
  position: relative;
  overflow: hidden;
}

canvas.sig-canvas {
  display: block;
  width: 100%;
  height: 200px;
  touch-action: none;
  cursor: crosshair;
}

.sig-clear {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 12px;
  color: var(--text-light);
  cursor: pointer;
  background: rgba(255,255,255,0.8);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-family: var(--font-body);
}

.sig-hint {
  font-size: 12px;
  color: var(--text-light);
  text-align: center;
  margin-top: 6px;
}

/* ---- Nav Footer ---- */
.nav-footer {
  flex-shrink: 0;
  padding: 14px 24px;
  display: flex;
  gap: 12px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.btn {
  flex: 1;
  height: 54px;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  letter-spacing: 0.02em;
}

.btn-back {
  background: var(--background);
  color: var(--text-medium);
  border: 1.5px solid var(--border);
  flex: 0 0 100px;
}

.btn-next { background: var(--primary); color: #fff; }
.btn-next:active  { background: var(--primary-dark); }
.btn-back:active  { background: var(--border); }
.btn:disabled     { opacity: 0.45; cursor: not-allowed; }

/* ---- Welcome Step ---- */
.welcome-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 48px;
}

.welcome-logo {
  font-family: var(--font-heading);
  font-size: 44px;
  font-weight: 300;
  color: var(--primary);
  letter-spacing: 0.1em;
  margin-bottom: 4px;
}

.welcome-tagline {
  font-size: 11px;
  color: var(--text-light);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 36px;
}

.welcome-icon  { font-size: 60px; margin-bottom: 20px; }

.welcome-title {
  font-family: var(--font-heading);
  font-size: 34px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 14px;
}

.welcome-message {
  font-size: 16px;
  color: var(--text-light);
  line-height: 1.75;
  max-width: 420px;
}

/* ---- Confirmation Step ---- */
.confirm-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 64px;
}

.confirm-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.confirm-circle svg {
  width: 38px;
  height: 38px;
  stroke: #fff;
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---- Professional Section ---- */
.pro-banner {
  background: #EDE5DC;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.pro-banner-text {
  font-size: 13px;
  color: var(--text-medium);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.visit-entry {
  background: var(--background);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

.visit-number {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  margin-bottom: 14px;
}

/* ---- PIN Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(44, 36, 32, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(4px);
}

.modal-overlay.visible { display: flex; }

.modal {
  background: var(--surface);
  border-radius: 20px;
  padding: 32px 28px 28px;
  width: 320px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(44,36,32,0.18);
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 26px;
  color: var(--text);
  margin-bottom: 4px;
}

.modal-subtitle {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 24px;
}

.pin-display {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-bottom: 20px;
}

.pin-dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid var(--border);
  transition: all 0.15s;
}

.pin-dot.filled {
  background: var(--primary);
  border-color: var(--primary);
}

.pin-error {
  font-size: 13px;
  color: var(--danger);
  min-height: 20px;
  margin-bottom: 10px;
}

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.pin-key {
  height: 58px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--background);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  font-family: var(--font-body);
  transition: background 0.1s, color 0.1s;
}

.pin-key:active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.pin-key.pin-cancel { font-size: 14px; color: var(--text-light); }
.pin-key.pin-delete { font-size: 18px; color: var(--text-medium); }

/* ---- Landing Page ---- */
.landing {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  background: var(--page-bg);
}

.landing-logo {
  font-family: var(--font-heading);
  font-size: 56px;
  font-weight: 300;
  color: var(--primary);
  letter-spacing: 0.1em;
  text-align: center;
  margin-bottom: 4px;
}

.landing-tagline {
  font-size: 11px;
  color: var(--text-light);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 56px;
}

.landing-prompt {
  font-size: 17px;
  color: var(--text-medium);
  text-align: center;
  margin-bottom: 28px;
}

.form-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 420px;
}

.form-card {
  display: block;
  padding: 28px 24px;
  background: var(--surface);
  border-radius: 16px;
  border: 1.5px solid var(--border);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  text-align: center;
}

.form-card:active {
  border-color: var(--primary);
  transform: scale(0.98);
}

.form-card-icon  { font-size: 30px; margin-bottom: 8px; display: block; }
.form-card-title { font-family: var(--font-heading); font-size: 26px; color: var(--text); margin-bottom: 4px; }
.form-card-desc  { font-size: 14px; color: var(--text-light); line-height: 1.5; }

.pro-login-btn {
  margin-top: 40px;
  font-size: 13px;
  color: var(--text-light);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---- Utilities ---- */
.divider      { height: 1px; background: var(--border); margin: 24px 0; }
.mt-8         { margin-top: 8px; }
.mt-16        { margin-top: 16px; }
.mt-24        { margin-top: 24px; }
.text-center  { text-align: center; }
.error-msg    { font-size: 13px; color: var(--danger); margin-top: 6px; display: none; }
.error-msg.visible { display: block; }

/* ---- Responsive tweaks for larger iPads ---- */
@media (min-width: 768px) {
  .step { padding: 40px 40px 28px; }
  .nav-footer { padding: 16px 40px; }
  .app-header { padding: 18px 40px 0; padding-bottom: 12px; }
}
