/* ==========================================================================
   Design tokens — change these to re-theme the whole site. Nothing below
   this block hardcodes a color, radius, or shadow value.
   ========================================================================== */
:root {
  /* Brand */
  --brand: #3457d5;
  --brand-dark: #2743ab;
  --brand-light: #eef2ff;

  /* Neutrals */
  --bg: #f7f8fa;
  --surface: #ffffff;
  --border: #e1e4ea;
  --text: #171b2e;
  --text-muted: #6b7280;
  --text-faint: #9aa1af;

  /* Feedback */
  --success: #16a34a;
  --error: #dc2626;

  /* Shape */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  /* Elevation */
  --shadow-sm: 0 1px 2px rgba(23, 27, 46, 0.05);
  --shadow-md: 0 6px 20px rgba(23, 27, 46, 0.07);

  /* Type */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.page {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 60px 20px 64px;
}

.content {
  width: 100%;
  max-width: 440px;
}

/* ==========================================================================
   Header — see the HEADER PLACEHOLDER comment in index.html. This block is
   built to hold real copy later without any layout changes.
   ========================================================================== */
.site-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  margin-bottom: 36px;
}

.brand-mark {
  width: 150px;
  height: auto;
  flex-shrink: 0;
}

.header-intro {
  margin: 0;
  font-size: clamp(14px, 3.6vw, 15px);
  line-height: 1.5;
  color: var(--text-muted);
  max-width: 34ch;
}

.header-intro.placeholder-copy {
  font-style: italic;
  color: var(--text-faint);
}

/* ==========================================================================
   Form layout
   ========================================================================== */
.form {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.field-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

/* ==========================================================================
   Copyable text box
   ========================================================================== */
.copy-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  position: relative;
}

.copy-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.copy-box-label {
  font-size: 13px;
  color: var(--text-faint);
}

.copy-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
}

.copy-btn:hover {
  background: var(--bg);
  color: var(--brand);
}

/* Fixed height + internal scroll, so long entries never resize the box or
   push the rest of the page around. */
.copy-box-content {
  height: 120px;
  overflow-y: auto;
  padding: 14px;
}

.copy-box-content p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}

.copy-box-content:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

/* Hints that there's more to scroll to, without scrolling itself. */
.copy-box::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 22px;
  background: linear-gradient(to bottom, transparent, var(--surface));
  pointer-events: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.copy-feedback {
  font-size: 12px;
  color: var(--success);
  font-weight: 600;
  min-height: 14px;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.link-button,
.submit-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--brand);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.link-button:hover,
.submit-button:not(:disabled):hover {
  background: var(--brand-dark);
}

.link-button.is-disabled,
.submit-button:disabled {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}

/* ==========================================================================
   Upload box — click (or drop) to attach the required photo
   ========================================================================== */
.upload-box {
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-faint);
  cursor: pointer;
}

.upload-box:hover {
  border-color: var(--brand);
}

.upload-title {
  margin: 6px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
}

.upload-hint {
  margin: 0;
  font-size: 12px;
  color: var(--text-faint);
}

.upload-preview {
  max-width: 100%;
  max-height: 140px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.field-error {
  display: block;
  min-height: 14px;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--error);
}

.submit-feedback {
  display: block;
  min-height: 14px;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.submit-feedback.is-error {
  color: var(--error);
}

.submit-feedback.is-success {
  color: var(--success);
}

/* ==========================================================================
   Icon-prefixed inputs
   ========================================================================== */
.input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-faint);
  pointer-events: none;
}

.input-group input,
.input-group select {
  width: 100%;
  padding: 12px 14px 12px 40px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  appearance: none;
}

.input-group input::placeholder {
  color: var(--text-faint);
}

.input-group input:focus,
.input-group select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-light);
}

/* ==========================================================================
   Responsive tweaks for narrow phones
   ========================================================================== */
@media (max-width: 360px) {
  .page {
    padding: 28px 14px 48px;
  }
  .copy-box-content {
    height: 100px;
  }
}

/* ============ BEGIN DEBUG PANEL ============
   Dev-only. Doesn't touch any selector used above, so deleting this block
   (and the matching HTML + JS blocks) is always safe. */
#debug-panel {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 999;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  background: #fff8dd;
  border: 1px dashed #b8a400;
  border-radius: 8px;
  padding: 6px 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: #6b5e00;
  width: max-content;
}

#debug-panel input {
  width: 44px;
  padding: 3px 5px;
  border: 1px solid #b8a400;
  border-radius: 4px;
  font-family: inherit;
  font-size: 12px;
}

#debug-entry-total {
  opacity: 0.7;
  white-space: nowrap;
}

#debug-progress {
  opacity: 0.7;
  white-space: nowrap;
  border-left: 1px dashed #b8a400;
  padding-left: 6px;
  margin-left: 2px;
}
/* ============= END DEBUG PANEL ============= */
