/* ==========================================================================
   Professor Tero Collectibles — lead form, styled as card furniture
   ========================================================================== */

.form-shell { max-width: 680px; }

/* honeypot: off-screen, NOT display:none (bots skip display:none fields) */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  top: auto; width: 1px; height: 1px;
  overflow: hidden;
}

.field { margin-bottom: 1.6rem; }
.field > label,
.field-group > legend {
  display: block;
  font-size: var(--t-sm);
  font-weight: 700;
  margin-bottom: .45rem;
  color: var(--paper);
}
.field .req { color: var(--accent); font-weight: 600; font-size: .85em; margin-left: .25em; }
.field .opt { color: var(--muted-2); font-weight: 400; font-size: .85em; margin-left: .25em; }
.field .hint {
  display: block; color: var(--muted); font-size: var(--t-sm);
  margin: -.15rem 0 .55rem; font-weight: 400; line-height: 1.5; max-width: 58ch;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
select,
textarea {
  width: 100%;
  min-height: 50px;
  padding: .7rem .9rem;
  background: rgba(6, 4, 18, .5);
  border: 1px solid var(--edge);
  border-radius: var(--r);
  color: var(--paper);
  font-size: var(--t-0);
  transition: border-color .15s ease, background .15s ease;
}
textarea { min-height: 145px; resize: vertical; line-height: 1.6; }
input::placeholder, textarea::placeholder { color: #8A7EAA; }

input:hover, select:hover, textarea:hover { border-color: rgba(185, 192, 208, .5); }
input:focus, select:focus, textarea:focus {
  border-color: var(--frame);
  background: rgba(10, 8, 26, .72);
  outline: none;
}
input[aria-invalid="true"],
select[aria-invalid="true"],
textarea[aria-invalid="true"] { border-color: var(--err); }

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--accent) 50%),
                    linear-gradient(135deg, var(--accent) 50%, transparent 50%);
  background-position: calc(100% - 20px) 22px, calc(100% - 14px) 22px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 2.6rem;
}

/* ---------- radio / checkbox groups ---------- */
.field-group { border: 0; padding: 0; margin: 0 0 1.6rem; }
.field-group legend { padding: 0; }
/* real gap + a border per option: an unfilled last row leaves no ghost cell */
.choices { display: grid; gap: .45rem; margin-top: .55rem; }
.choices-2 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

/* the whole row is the tap target, not the control */
.choice {
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: .65rem;
  min-height: 50px; padding: .75rem .95rem;
  background: rgba(6, 4, 18, .42);
  border: 1px solid var(--edge-soft);
  border-radius: var(--r);
  cursor: pointer;
  font-size: var(--t-sm); font-weight: 500;
  transition: background .12s ease, border-color .12s ease;
}
.choice:hover { background: rgba(10, 8, 26, .7); border-color: var(--edge); }
.choice input { flex: none; width: 18px; height: 18px; margin: .1rem 0 0; accent-color: var(--frame); cursor: pointer; }
.choice:has(input:checked) { border-color: var(--frame); background: rgba(185, 192, 208, .12); }
.choice:has(input:focus-visible) { outline: 2px solid var(--frame); outline-offset: 2px; }
.choice-t { flex: 1 1 0; min-width: 0; }
.choice small {
  flex: 1 0 100%; padding-left: 1.65rem; margin-top: .1rem;
  font-weight: 400; color: var(--muted-2); font-size: var(--t-xs); line-height: 1.4;
}

/* ---------- errors ---------- */
.err-msg { display: none; margin-top: .4rem; color: var(--err); font-size: var(--t-sm); font-weight: 600; }
.err-msg.is-shown { display: block; }

.form-alert {
  display: none;
  margin-bottom: 1.6rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--err);
  border-left-width: 3px;
  border-radius: var(--r);
  background: rgba(255, 154, 154, .08);
}
.form-alert.is-shown { display: block; }
.form-alert h2 {
  color: var(--err); font-size: var(--t-0); font-weight: 800;
  letter-spacing: -.01em; margin-bottom: .3rem;
}
.form-alert p { color: var(--muted); font-size: var(--t-sm); margin-bottom: 0; }

/* ---------- conditional block ---------- */
[hidden] { display: none !important; }
.conditional { border-left: 1px solid var(--edge-soft); padding-left: 1.3rem; margin-left: .1rem; }

/* ---------- submit ---------- */
.form-foot { margin-top: 2rem; padding-top: 1.6rem; border-top: 1px solid var(--edge-soft); }
.form-note { color: var(--muted); font-size: var(--t-sm); margin-bottom: 1.1rem; max-width: 54ch; }
.btn-submit { min-width: 240px; }   /* fixed width so the label swap doesn't shift layout */
.btn-submit[disabled] { opacity: .6; cursor: progress; transform: none; }
.cf-turnstile { margin-bottom: 1.1rem; }
.cf-turnstile:empty { display: none; }

/* ---------- success ---------- */
.form-success {
  border: 1px solid var(--edge);
  border-left: 3px solid var(--ok);
  border-radius: var(--r);
  background: rgba(6, 4, 18, .45);
  padding: 2rem 1.75rem;
}
.form-success:focus { outline: 2px solid var(--frame); outline-offset: 3px; }
.form-success h2 { color: var(--paper); font-size: var(--t-2); margin-bottom: .7rem; }
.form-success p { color: var(--muted); }
.form-success ul { padding-left: 1.05rem; margin-bottom: 1rem; }
.form-success li { margin-bottom: .45rem; color: var(--muted); }
.form-success li b { color: var(--paper); font-weight: 700; }
.form-success li::marker { color: var(--accent); }

/* ---------- contact page: form beside a reassurance rail ---------- */
.contact-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px;
  gap: clamp(1.5rem, 3vw, 2.75rem); align-items: start;
}
@media (max-width: 940px) {
  .contact-layout { grid-template-columns: 1fr; }
  /* on narrow screens the reassurance belongs above the form, where it can
     still do its job before someone starts typing */
  .contact-aside { order: -1; }
}
.contact-main { min-width: 0; }
.contact-main .form-shell { max-width: none; }

.contact-aside { display: grid; gap: .8rem; position: sticky; top: 84px; }
@media (max-width: 940px) { .contact-aside { position: static; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); } }

.aside-card {
  background: rgba(10, 8, 24, .5);
  border: 1px solid var(--edge-soft);
  border-radius: var(--r);
  padding: 1.15rem 1.25rem;
}
.aside-card h3 {
  font-size: var(--t-xs); font-weight: 800; letter-spacing: .16em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 .6rem;
}
.aside-card p { font-size: var(--t-sm); color: var(--muted); margin: 0; line-height: 1.55; }
.aside-quiet { background: transparent; border-style: dashed; }

.aside-steps { margin: 0; padding: 0; list-style: none; counter-reset: a; display: grid; gap: .55rem; }
.aside-steps li {
  counter-increment: a; position: relative; padding-left: 1.75rem;
  font-size: var(--t-sm); color: var(--muted); line-height: 1.5;
}
.aside-steps li::before {
  content: counter(a); position: absolute; left: 0; top: .05em;
  width: 19px; height: 19px; border-radius: 50%;
  background: rgba(185, 192, 208, .14); color: var(--accent);
  font-size: .68rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.aside-steps b { color: var(--paper); font-weight: 700; }

/* ==========================================================================
   The form now lives inside a card's cream text box. The rules above use
   hardcoded dark rgba() backgrounds that a token override cannot reach, so
   they are restated here for the light surface.
   ========================================================================== */

.card-box input[type="text"],
.card-box input[type="email"],
.card-box input[type="tel"],
.card-box input[type="url"],
.card-box select,
.card-box textarea {
  background: #FFFDF7;
  border-color: #C2AE84;
  color: var(--box-ink);
}
.card-box input::placeholder,
.card-box textarea::placeholder { color: #9C8A67; }

.card-box input:hover, .card-box select:hover, .card-box textarea:hover { border-color: #9A7414; }
.card-box input:focus, .card-box select:focus, .card-box textarea:focus {
  border-color: var(--gold-dk);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(233, 185, 62, .35);
}
.card-box input[aria-invalid="true"],
.card-box select[aria-invalid="true"],
.card-box textarea[aria-invalid="true"] { border-color: var(--err); }

.card-box .choice {
  background: #FFFDF7;
  border-color: #C7B48A;
  color: var(--box-ink);
}
.card-box .choice:hover { background: #fff; border-color: #9A7414; }
.card-box .choice:has(input:checked) {
  border-color: var(--gold-dk);
  background: rgba(233, 185, 62, .22);
}
.card-box .choice small { color: #7A6A4E; }
.card-box .choice input { accent-color: var(--gold-dk); }

.card-box .field .req { color: #9A5B0E; }
.card-box .field .hint { color: var(--box-mut); }

.card-box .err-msg { color: var(--err); }
.card-box .form-alert {
  background: rgba(179, 52, 31, .1);
  border-color: var(--err);
}
.card-box .form-alert h2 { color: var(--err); }

.card-box .form-foot { border-top-color: rgba(35, 24, 11, .2); }
.card-box .conditional { border-left-color: rgba(35, 24, 11, .2); }

.card-box .form-success {
  background: rgba(47, 143, 85, .1);
  border-color: rgba(35, 24, 11, .2);
  border-left-color: var(--ok);
}
.card-box .form-success h2 { color: #1F6B3C; }

/* the reassurance rail — dark tiles on cream read as holes */
.card-box .aside-card {
  background: rgba(233, 185, 62, .14);
  border-color: #C7B48A;
}
.card-box .aside-card h3 { color: #8A6712; }
.card-box .aside-card p { color: var(--box-mut); }
.card-box .aside-quiet { background: transparent; border-style: dashed; }
.card-box .aside-steps li { color: var(--box-mut); }
.card-box .aside-steps li::before { background: var(--gold); color: #20170A; }
.card-box .aside-steps b { color: var(--box-ink); }

/* ---------- photo attachments ---------- */

input[type="file"] {
  width: 100%;
  padding: .7rem .8rem;
  background: #FFFDF7;
  border: 1px dashed #B49B63;
  border-radius: var(--r);
  color: var(--box-ink);
  font-size: var(--t-sm);
  cursor: pointer;
}
input[type="file"]::file-selector-button {
  margin-right: .8rem; padding: .45rem .9rem;
  background: var(--gold); color: #20170A;
  border: 1px solid #8A6712; border-radius: 6px;
  font-weight: 800; font-size: var(--t-sm); cursor: pointer;
}
input[type="file"]:hover { border-color: var(--gold-dk); }
input[type="file"]:disabled { opacity: .55; cursor: not-allowed; }

.shots {
  list-style: none; padding: 0;
  margin: .7rem 0 0;
  display: grid; gap: .55rem;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
}
.shots:empty { display: none; }

.shot {
  position: relative;
  border: 2px solid var(--gold-dk); border-radius: 6px;
  overflow: hidden; background: #E9DFC5;
  aspect-ratio: 1;
}
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot.is-uploading img { opacity: .45; }
.shot.is-error { border-color: var(--err); }
.shot.is-error img { opacity: .3; }

.shot-status {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: .2rem .35rem;
  font-size: .58rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  background: rgba(35, 24, 11, .8); color: #F4ECD9; text-align: center;
}
.shot.is-ready .shot-status { background: rgba(47, 143, 85, .88); }
.shot.is-error .shot-status { background: rgba(179, 52, 31, .9); }

/* 28px is below the 44px guidance, but this control sits ON a 96px thumbnail
   that is itself the touch context, and a 44px button would cover a third of
   the image it removes. The full filename is on the aria-label. */
.shot-remove {
  position: absolute; top: 3px; right: 3px;
  width: 26px; height: 26px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(35, 24, 11, .82); color: #F4ECD9;
  border: 0; border-radius: 50%;
  font-size: 1rem; line-height: 1; cursor: pointer;
}
.shot-remove:hover { background: var(--err); }
