/* ============================================================
   Tattoo Inquiry Form v2 – Frontend Styles
   ============================================================ */

:root {
  --tif-bg:           #ffffff;
  --tif-text:         #1a1a1a;
  --tif-accent:       #1a1a1a;
  --tif-accent-inv:   #ffffff;
  --tif-border:       #e2e2e2;
  --tif-choice-bg:    #f4f4f2;
  --tif-choice-hover: #eaeae7;
  --tif-sel-bg:       #1a1a1a;
  --tif-sel-text:     #ffffff;
  --tif-radius:       10px;
  --tif-font:         -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, sans-serif;
  --tif-speed:        0.18s;
}

/* ── Wrapper ────────────────────────────────────────────────────────────── */
.tif-wrapper {
  font-family: var(--tif-font);
  color: var(--tif-text);
  background: var(--tif-bg);
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px 80px;
  min-height: 60vh;
}
.tif-loading {
  color: #aaa;
  padding: 40px 0;
  text-align: center;
  font-size: 15px;
}

/* ── Progress bar ───────────────────────────────────────────────────────── */
.tif-progress-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 3px;
  background: var(--tif-border);
  margin: 0 -16px 44px;
}
.tif-progress-fill {
  height: 100%;
  background: var(--tif-accent);
  transition: width 0.4s cubic-bezier(.4,0,.2,1);
}

/* ── Steps ──────────────────────────────────────────────────────────────── */
.tif-step { display: none; }
.tif-step.active { display: block; animation: tifIn 0.26s ease; }
@keyframes tifIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tif-shake {
  animation: tifShake 0.38s ease !important;
}
@keyframes tifShake {
  0%,100%{ transform: translateX(0); }
  20%    { transform: translateX(-8px); }
  40%    { transform: translateX(8px); }
  60%    { transform: translateX(-5px); }
  80%    { transform: translateX(5px); }
}

/* ── Step header ────────────────────────────────────────────────────────── */
.tif-step-header { margin-bottom: 28px; }
.tif-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  background: var(--tif-accent);
  color: var(--tif-accent-inv);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
}
.tif-step-number--last::after { content: "✓"; }
.tif-question {
  font-size: clamp(20px, 4vw, 28px);
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 6px;
}
.tif-required { color: #e63946; margin-left: 2px; }
.tif-sub {
  font-size: 15px;
  color: #666;
  margin: 4px 0 0;
  line-height: 1.55;
}

/* ══════════════════════════════════════════════════════════════════════════
   CHOICE GROUPS
══════════════════════════════════════════════════════════════════════════ */

/* shared choice reset */
.tif-choice {
  font-family: var(--tif-font);
  border: 2px solid transparent;
  cursor: pointer;
  transition:
    background var(--tif-speed),
    border-color var(--tif-speed),
    transform var(--tif-speed),
    box-shadow var(--tif-speed);
  outline: none;
  text-align: left;
  color: var(--tif-text);
  background: var(--tif-choice-bg);
}
.tif-choice:focus-visible { box-shadow: 0 0 0 3px rgba(0,0,0,0.25); }

/* ── List layout ──────────────────────────────────────────────────────── */
.tif-choices--list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
}
.tif-choices--list .tif-choice {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: var(--tif-radius);
  padding: 14px 18px;
  font-size: 16px;
  width: 100%;
}
.tif-choices--list .tif-choice:hover { background: var(--tif-choice-hover); border-color: #aaa; }
.tif-choices--list .tif-choice.selected { background: var(--tif-sel-bg); color: var(--tif-sel-text); border-color: var(--tif-sel-bg); }

/* ── Grid-3 layout ────────────────────────────────────────────────────── */
.tif-choices--grid3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
  margin-bottom: 28px;
}
.tif-choices--grid3 .tif-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: var(--tif-radius);
  padding: 13px 14px;
  font-size: 15px;
}
.tif-choices--grid3 .tif-choice:hover { background: var(--tif-choice-hover); border-color: #aaa; }
.tif-choices--grid3 .tif-choice.selected { background: var(--tif-sel-bg); color: var(--tif-sel-text); border-color: var(--tif-sel-bg); }

/* ── Cards layout (large image + label) ──────────────────────────────── */
.tif-choices--cards {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 28px;
}
.tif-choice--card {
  display: flex;
  flex-direction: column;
  align-items: center;
  border-radius: var(--tif-radius);
  padding: 0 0 12px;
  overflow: hidden;
  flex: 1 1 175px;
  max-width: 220px;
}
.tif-choice--card:hover { background: var(--tif-choice-hover); border-color: #aaa; transform: translateY(-2px); }
.tif-choice--card.selected { border-color: var(--tif-sel-bg); box-shadow: 0 0 0 3px rgba(0,0,0,0.1); }

.tif-card-visual {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: #eee;
  margin-bottom: 10px;
}
.tif-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.tif-choice--card:hover .tif-card-img { transform: scale(1.04); }
.tif-card-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #e8e8e5 0%, #d0d0cb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: #bbb;
}
.tif-card-label {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--tif-text);
}
.tif-choice-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #666;
}
.tif-choice--card.selected .tif-choice-badge { color: var(--tif-text); }

/* ── Image grid layout (style tiles) ─────────────────────────────────── */
.tif-choices--grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}
.tif-choice--style {
  display: flex;
  flex-direction: column;
  border-radius: var(--tif-radius);
  overflow: hidden;
  padding: 0;
}
.tif-choice--style:hover { border-color: #aaa; transform: translateY(-2px); }
.tif-choice--style.selected { border-color: var(--tif-sel-bg); box-shadow: 0 0 0 3px rgba(0,0,0,0.1); }

.tif-style-img {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: #eee;
}
.tif-style-img-real {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.tif-choice--style:hover .tif-style-img-real { transform: scale(1.05); }
.tif-style-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e8e8e5 0%, #d0d0cb 100%);
  font-size: 13px;
  font-weight: 600;
  color: #888;
  text-align: center;
  padding: 8px;
  box-sizing: border-box;
}
.tif-choice--style .tif-choice-badge {
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 500;
  background: var(--tif-choice-bg);
  justify-content: flex-start;
}
.tif-choice--style.selected .tif-choice-badge {
  background: var(--tif-sel-bg);
  color: var(--tif-sel-text);
}

/* ── Choice key letter ────────────────────────────────────────────────── */
.tif-choice-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  border: 1.5px solid currentColor;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  opacity: 0.55;
  flex-shrink: 0;
}
.tif-choice.selected .tif-choice-key { opacity: 1; }

/* ══════════════════════════════════════════════════════════════════════════
   TEXT / TEXTAREA
══════════════════════════════════════════════════════════════════════════ */
.tif-text-group { margin-bottom: 28px; }
.tif-textarea {
  width: 100%;
  border: none;
  border-bottom: 2px solid var(--tif-border);
  background: transparent;
  font-family: var(--tif-font);
  font-size: 18px;
  color: var(--tif-text);
  padding: 8px 0;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
  transition: border-color var(--tif-speed);
}
.tif-textarea:focus { border-bottom-color: var(--tif-accent); }
.tif-hint { display: block; margin-top: 6px; font-size: 12px; color: #aaa; }

/* ══════════════════════════════════════════════════════════════════════════
   CONTACT STEP
══════════════════════════════════════════════════════════════════════════ */
.tif-contact-fields { display: flex; flex-direction: column; gap: 22px; margin-bottom: 28px; }
.tif-field-group { display: flex; flex-direction: column; gap: 5px; }
.tif-label { font-size: 13px; font-weight: 600; color: #666; }
.tif-phone-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 2px solid var(--tif-border);
  padding-bottom: 4px;
  transition: border-color var(--tif-speed);
}
.tif-phone-wrap:focus-within { border-bottom-color: var(--tif-accent); }
.tif-flag { font-size: 20px; line-height: 1; flex-shrink: 0; }
.tif-input {
  border: none;
  border-bottom: 2px solid var(--tif-border);
  background: transparent;
  font-family: var(--tif-font);
  font-size: 18px;
  color: var(--tif-text);
  padding: 8px 0;
  outline: none;
  width: 100%;
  transition: border-color var(--tif-speed);
}
.tif-phone-wrap .tif-input { border: none; }
.tif-input:focus { border-bottom-color: var(--tif-accent); }

/* ══════════════════════════════════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════════════════════════════════ */
.tif-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.tif-btn-ok,
.tif-btn-submit {
  background: var(--tif-accent);
  color: var(--tif-accent-inv);
  border: 2px solid transparent;
  border-radius: 6px;
  padding: 12px 26px;
  font-size: 15px;
  font-weight: 700;
  font-family: var(--tif-font);
  cursor: pointer;
  transition: opacity var(--tif-speed), transform var(--tif-speed);
  letter-spacing: 0.01em;
}
.tif-btn-ok:hover,
.tif-btn-submit:hover { opacity: 0.82; transform: translateY(-1px); }
.tif-btn-ok:active,
.tif-btn-submit:active { transform: none; opacity: 1; }
.tif-btn-submit:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.tif-btn-back {
  background: transparent;
  border: none;
  color: #999;
  font-size: 13px;
  font-family: var(--tif-font);
  cursor: pointer;
  padding: 4px 6px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.tif-btn-back:hover { color: var(--tif-text); }
.tif-keyboard-hint { font-size: 12px; color: #bbb; }
.tif-keyboard-hint kbd {
  background: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 11px;
  font-family: monospace;
}

/* ══════════════════════════════════════════════════════════════════════════
   ERRORS
══════════════════════════════════════════════════════════════════════════ */
.tif-error, .tif-inline-err {
  color: #e63946;
  font-size: 14px;
  margin-bottom: 10px;
  min-height: 18px;
}

/* ══════════════════════════════════════════════════════════════════════════
   THANK YOU
══════════════════════════════════════════════════════════════════════════ */
.tif-step--thanks {
  text-align: center;
  padding: 70px 20px;
}
.tif-thanks-icon {
  color: var(--tif-accent);
  width: 64px; height: 64px;
  margin: 0 auto 22px;
}
.tif-thanks-icon svg { width: 100%; height: 100%; }
.tif-thanks-heading { font-size: 34px; font-weight: 700; margin: 0 0 12px; }
.tif-thanks-body {
  font-size: 17px;
  color: #666;
  max-width: 420px;
  margin: 0 auto;
  line-height: 1.65;
}

/* ══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 560px) {
  .tif-choices--cards { flex-direction: column; }
  .tif-choice--card {
    flex-direction: row;
    max-width: 100%;
    padding: 0 14px 0 0;
    align-items: center;
    gap: 14px;
  }
  .tif-card-visual { width: 80px; height: 80px; flex-shrink: 0; margin-bottom: 0; aspect-ratio: auto; }
  .tif-card-label  { font-size: 13px; }
  .tif-choices--grid { grid-template-columns: repeat(auto-fill, minmax(120px,1fr)); }
  .tif-choices--grid3 { grid-template-columns: repeat(2, 1fr); }
  .tif-btn-ok, .tif-btn-submit { width: 100%; justify-content: center; }
}
