/* =====================================================================
   Advance Information Upload Applet — theme
   Aligned to the DRP Design Specification v2.3 (June 2026): Open Sans for
   all UI, Shadows Into Light Two for the brand wordmark, the #1B9413 /
   #4D8D3F green system on a warm off-white #F5F5F3, 12px cards, 8px
   inputs/buttons, 44px touch targets, splash with tap-to-enter video.
   ===================================================================== */

:root {
  --primary: #1B9413;
  --primary-dark: #157A0F;
  --secondary: #4D8D3F;
  --bg: #F5F5F3;
  --card: #FFFFFF;
  --text: #2C2A26;
  --text-secondary: #4A4A4A;
  --border: #E0E0E0;
  --error: #D32F2F;
  --warning: #F57C00;
  --info: #1976D2;
  --success: #388E3C;
  --shadow: rgba(0, 0, 0, 0.08);
  --panel: #F7F7F5;
  --radius-card: 12px;
  --radius-control: 8px;
  --maxw: 600px;
  --font: "Open Sans", Arial, sans-serif;
  --font-brand: "Shadows Into Light Two", "Open Sans", cursive;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 28px 18px calc(56px + env(safe-area-inset-bottom));
}

/* --- Masthead ----------------------------------------------------------- */
.masthead { text-align: center; padding: 6px 0 22px; }
.masthead img.logo {
  width: 96px; height: auto; display: inline-block; border-radius: 12px;
}
.masthead .wordmark {
  margin: 6px 0 0;
  font-family: var(--font-brand);
  font-size: 30px;
  line-height: 1.1;
  color: var(--secondary);
  font-weight: 400;
}
.masthead .wordmark .tm { font-family: var(--font); font-size: 0.35em; vertical-align: super; }

/* --- Headings ----------------------------------------------------------- */
h1.page-title {
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text);
  font-weight: 700;
  margin: 14px 0 2px;
  text-align: center;
}
.subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
  margin: 0 0 22px;
}

/* --- Cards -------------------------------------------------------------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 16px 18px;
  margin: 0 0 12px;
  box-shadow: 0 1px 4px var(--shadow);
}
.card h2 {
  font-size: 0.8rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 0 0 12px;
  font-weight: 700;
}

/* Session confirmation rows */
.detail-row { display: flex; gap: 12px; padding: 7px 0; border-top: 1px solid var(--border); }
.detail-row:first-of-type { border-top: 0; }
.detail-row .label { flex: 0 0 130px; color: var(--text-secondary); font-size: 0.875rem; }
.detail-row .value { flex: 1; color: var(--text); font-size: 0.95rem; }

/* --- Guidance / terms --------------------------------------------------- */
.guidance p { margin: 0 0 10px; font-size: 0.9rem; }
.guidance a { color: var(--secondary); }
.terms {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  padding: 14px 16px;
  font-size: 0.8rem;
  color: var(--text);
  background: #fcfdfb;
}
.terms p { margin: 0 0 10px; }

/* --- Form --------------------------------------------------------------- */
label.field-label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0 0 6px;
}
input[type="text"],
input[type="email"],
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  font-family: var(--font);
  font-size: 1rem;
  color: var(--text);
  background: var(--card);
  min-height: 44px;
}
input:focus, textarea:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-color: var(--primary);
}
textarea { min-height: 84px; resize: vertical; }
.field { margin: 0 0 16px; }

/* File drop / picker */
.dropzone {
  border: 1.5px dashed #c4ccbe;
  border-radius: var(--radius-control);
  padding: 24px 18px;
  text-align: center;
  color: var(--text-secondary);
  cursor: pointer;
  min-height: 44px;
  transition: border-color .15s, background .15s;
}
.dropzone.drag { border-color: var(--primary); background: #eef6ec; }
.dropzone strong { color: var(--primary); }
.hint { font-size: 0.75rem; color: var(--text-secondary); margin-top: 6px; }

/* Checkbox row */
.check-row { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 4px; }
.check-row input { margin-top: 4px; width: 18px; height: 18px; }
.check-row label { font-size: 0.9rem; color: var(--text); }

/* --- Buttons ------------------------------------------------------------ */
.btn {
  display: inline-block;
  width: 100%;
  padding: 14px 24px;
  min-height: 44px;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--primary);
  color: #fff;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn:hover, .btn:focus { background: var(--primary-dark); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* --- File progress list ------------------------------------------------- */
.file-list { list-style: none; margin: 8px 0 0; padding: 0; }
.file-item { padding: 10px 0; border-top: 1px solid var(--border); }
.file-item:first-child { border-top: 0; }
.file-item .name { font-size: 0.9rem; color: var(--text); display: flex; justify-content: space-between; gap: 10px; }
.file-item .meta { font-size: 0.75rem; color: var(--text-secondary); }
.bar { height: 6px; background: #eceee8; border-radius: 4px; margin-top: 6px; overflow: hidden; }
.bar > span { display: block; height: 100%; width: 0; background: var(--primary); transition: width .2s; }
.file-item.done .state { color: var(--success); }
.file-item.error .state { color: var(--error); }
.state { font-size: 0.75rem; }

/* --- Status banners ----------------------------------------------------- */
.banner { border-radius: var(--radius-control); padding: 14px 16px; font-size: 0.9rem; margin: 0 0 16px; }
.banner.error { background: #fbeeec; color: var(--error); border: 1px solid #efcdc8; }
.banner.ok { background: #eef6ec; color: var(--success); border: 1px solid #cfe6c7; }
.banner .icon { font-weight: 700; margin-right: 6px; }

/* --- Success screen ----------------------------------------------------- */
.success { text-align: center; padding: 8px 0; }
.success .tick {
  width: 56px; height: 56px; border-radius: 50%;
  background: #eef6ec; color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 28px; margin-bottom: 12px;
}

.center { text-align: center; }
.muted { color: var(--text-secondary); }
.hidden { display: none !important; }
.spinner {
  width: 28px; height: 28px; border: 3px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 0.8s linear infinite; margin: 24px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

footer.legal {
  margin-top: 26px;
  font-size: 0.6875rem;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.5;
}
footer.legal a { color: var(--text-secondary); }

/* --- Splash screen (tap to enter -> logo video + sound) ------------------ */
#splash {
  position: fixed; inset: 0; z-index: 1000;
  background: #ffffff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: opacity 0.8s ease;
}
#splash.fade { opacity: 0; pointer-events: none; }
#splash .splash-logo { width: 110px; height: auto; border-radius: 12px; }
#splash video {
  width: min(90vw, 520px); height: auto; display: none; background: #fff;
}
#splash.playing .splash-logo,
#splash.playing .splash-prompt { display: none; }
#splash.playing video { display: block; }
.splash-prompt {
  margin-top: 22px;
  font-family: var(--font);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #999;
  animation: splashPulse 2s ease-in-out infinite;
}
@keyframes splashPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }

@media (max-width: 480px) {
  .detail-row { flex-direction: column; gap: 2px; }
  .detail-row .label { flex-basis: auto; }
  .wrap { padding: 20px 14px 48px; }
  .masthead .wordmark { font-size: 26px; }
}
