:root {
  --orange:   #f36b36;
  --dark:     #242424;
  --white:    #ffffff;
  --mid:      #707070;
  --muted:    #909090;
  --grey:     #cccccc;
  --line:     #e1e1e1;
  --light:    #f3f2f1;
  --alert:    #d13438;
  --ok:       #00b46e;
  /* Match the Teams adaptive-card look: Segoe UI first, sane fallbacks. */
  --sans:     'Segoe UI', -apple-system, BlinkMacSystemFont, system-ui, 'Roboto', sans-serif;
  --cond:     'Roboto Condensed', sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--sans);
  background: var(--light);
  color: var(--dark);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
}

/* ── Brand mark (callback page) ───────────────── */
.logo {
  font-family: var(--cond);
  font-weight: 700; font-size: 22px;
  color: var(--orange);
  transform: skewX(-11deg);
  display: inline-block;
  letter-spacing: -0.01em;
}

/* ── Card ─────────────────────────────────────── */
.card {
  position: relative;
  background: var(--white);
  width: 100%;
  max-width: 500px;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1.6px 3.6px rgba(0, 0, 0, 0.10), 0 0.3px 0.9px rgba(0, 0, 0, 0.07);
  padding: 20px;
  display: flex;
  flex-direction: column;
}

/* Hemmersbach logo, pinned 10px from the card's top-right corner. */
.card-logo {
  position: absolute;
  top: 10px;
  right: 10px;
  height: 30px;
  width: auto;
}

/* Form card stacks its sections with even spacing. */
#formState { gap: 16px; }

/* ── Title / subtitle ─────────────────────────── */
.card-head { display: flex; flex-direction: column; gap: 4px; padding-right: 44px; }
.form-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.3;
}
.form-subtitle {
  font-size: 14px;
  color: var(--mid);
  line-height: 1.4;
}

/* ── Fact set (label | value table) ───────────── */
.fact-set {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 16px;
}
.fact-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--dark);
}
.fact-value {
  font-size: 14px;
  color: var(--dark);
  line-height: 1.4;
}

/* ── Form body ───────────────────────────────── */
.form-body { display: flex; flex-direction: column; gap: 14px; }

.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-size: 14px;
  color: var(--dark);
  display: flex; align-items: baseline; gap: 4px;
}
.field-label .required { color: var(--alert); }
.field-label .optional { color: var(--muted); font-size: 13px; }

input[type="text"],
input[type="date"],
textarea,
select {
  width: 100%;
  background: var(--white);
  border: 1px solid var(--grey);
  border-radius: 4px;
  padding: 8px 10px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--dark);
  outline: none;
  appearance: none;
  transition: border-color 0.1s;
}
input[type="text"]:focus,
input[type="date"]:focus,
textarea:focus,
select:focus { border-color: var(--orange); }
textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23707070' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
input[type="date"]::-webkit-calendar-picker-indicator { opacity: 0.5; cursor: pointer; }

.checkbox-row {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; padding: 8px 10px;
  border: 1px solid var(--grey);
  border-radius: 4px;
  background: var(--white);
  user-select: none;
  transition: border-color 0.1s;
}
.checkbox-row:hover { border-color: var(--orange); }
.checkbox-row input[type="checkbox"] {
  width: 15px; height: 15px;
  accent-color: var(--orange);
  cursor: pointer; flex-shrink: 0;
}
.checkbox-label { font-size: 14px; color: var(--dark); }

/* ── Error banner ─────────────────────────────── */
.error-banner {
  display: none;
  padding: 9px 12px;
  border-left: 3px solid var(--alert);
  border-radius: 4px;
  background: #fdf3f4;
  font-size: 13px; color: var(--alert);
}

/* ── Action bar (pill buttons) ───────────────── */
.action-bar { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  padding: 11px 28px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 13px; font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.1s, background 0.1s, border-color 0.1s, color 0.1s;
}
.btn:hover:not(:disabled) { opacity: 0.9; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Approve — solid orange pill ("GET IN TOUCH"). */
.btn-positive,
.btn-primary {
  background: var(--orange);
  color: var(--white);
  border-color: var(--orange);
}
/* Reject — gray outlined pill ("CONTACT US NOW"). */
.btn-negative,
.btn-ghost {
  background: transparent;
  color: var(--mid);
  border-color: #b0b0b0;
}
.btn-negative:hover:not(:disabled),
.btn-ghost:hover:not(:disabled) { color: var(--dark); border-color: var(--mid); opacity: 1; }

/* ── Card footer (muted identity / record id) ── */
.card-footer {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 12px;
  border-top: 1px solid #ededed;
}
.card-footer span { font-size: 11px; color: var(--muted); }

/* ── State overlays (loading / auth / error) ─── */
.state-overlay {
  display: flex;
  flex-direction: column; align-items: center;
  justify-content: center;
  padding: 32px 24px; text-align: center; gap: 12px;
}
.state-icon-wrap {
  width: 48px; height: 48px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700;
  color: var(--white);
  margin-bottom: 4px;
}
.state-icon-wrap.orange  { background: var(--orange); }
.state-icon-wrap.red     { background: var(--alert); }
.state-icon-wrap.neutral { background: var(--mid); }

.state-title {
  font-size: 17px; font-weight: 700;
  color: var(--dark);
}
.state-sub {
  font-size: 14px; color: var(--mid);
  line-height: 1.5; max-width: 320px;
}

.sign-in-btn {
  margin-top: 8px;
  padding: 11px 28px;
  background: var(--orange); color: var(--white);
  border: none;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  cursor: pointer;
  transition: opacity 0.1s;
}
.sign-in-btn:hover { opacity: 0.9; }

.spinner {
  width: 28px; height: 28px;
  border: 2px solid var(--grey);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Callback page ───────────────────────────── */
.callback-screen {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; flex-direction: column; gap: 16px;
  padding: 0;
}
.callback-screen p { font-size: 13px; color: var(--mid); }
