/* =========================================================
   RaceCheck — style.css
   ========================================================= */

/* ── Reset & Base ─────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
}

body {
  font-family: 'Anuphan', sans-serif;
  background-color: #df1465;
  background-image: url('image/BG.png');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  color: #1a1a1a;
}

/* ── Page wrapper ─────────────────────────────────────── */
.page-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
}

/* ── Card ─────────────────────────────────────────────── */
.search-card {
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.08);
  width: 100%;
  max-width: 480px;
  padding: 40px 36px 44px;
  position: relative;
  overflow: hidden;
}

/* ── Card Header ──────────────────────────────────────── */
.card-header {
  text-align: center;
  margin-bottom: 28px;
}

.card-title {
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: #111111;
  line-height: 1.25;
}

.card-subtitle {
  margin-top: 4px;
  font-size: 0.9rem;
  color: #888;
  font-weight: 400;
  letter-spacing: 0.2px;
}

/* ── Search Section ───────────────────────────────────── */
.search-section {
  margin-bottom: 4px;
}

.section-label {
  font-size: 0.88rem;
  color: #555;
  font-weight: 500;
  margin-bottom: 10px;
}

/* ── Input ────────────────────────────────────────────── */
.input-wrap {
  position: relative;
}

.field {
  width: 100%;
  border: 1.5px solid #e0e0e0;
  border-radius: 99px;
  padding: 13px 20px;
  font-family: 'Anuphan', sans-serif;
  font-size: 0.95rem;
  color: #222;
  background: #fafafa;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.field::placeholder {
  color: #bbb;
}

.field:focus {
  border-color: #e0007e;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(224, 0, 126, 0.10);
}

.input-wrap--stacked {
  margin-top: 10px;
}

/* ── Divider ──────────────────────────────────────────── */
.divider {
  height: 1px;
  background: #f0f0f0;
  margin: 20px 0;
}

/* ── Error / Hint text ────────────────────────────────── */
.field-hint {
  font-size: 0.8rem;
  min-height: 1.2em;
  padding: 4px 4px 0;
}

.error-hint {
  color: #e0007e;
}

/* ── Confirm Button ───────────────────────────────────── */
.btn-confirm {
  display: block;
  width: 160px;
  margin: 16px auto 0;
  padding: 13px 0;
  background: linear-gradient(135deg, #e8005a 0%, #e0007e 100%);
  color: #fff;
  font-family: 'Anuphan', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 99px;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  box-shadow: 0 4px 18px rgba(224, 0, 100, 0.30);
}

.btn-confirm:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(224, 0, 100, 0.40);
}

.btn-confirm:active {
  transform: translateY(0);
  opacity: 0.9;
}

/* ── Result Page ──────────────────────────────────────── */
.result-page-wrapper {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* Back button */
.back-wrap {
  width: 100%;
  display: flex;
  justify-content: flex-start;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  color: #1e293b;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  padding: 6px 14px;
  border-radius: 99px;
  text-decoration: none;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.15s ease;
}

.back-btn:hover {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
  transform: translateX(-3px);
}

/* Result Card */
.result-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.03);
  padding: 38px 40px 32px;
  width: 100%;
  box-sizing: border-box;
}

/* Icon */
.result-icon-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.result-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-icon--ok {
  background-color: #55b71c;
}

/* Sequence No Badge */
.result-seq-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.result-seq-badge {
  display: inline-block;
  color: #e4007f;
  font-family: 'Anuphan', sans-serif;
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.result-icon--error {
  background-color: #ef4444;
}

/* Card heading & subheading */
.result-heading {
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  color: #0f172a;
  line-height: 1.3;
  margin: 0 0 4px;
  letter-spacing: -0.2px;
}

.result-subheading {
  font-size: 0.82rem;
  color: #94a3b8;
  text-align: center;
  font-weight: 400;
  margin: 0 0 24px;
  letter-spacing: 0.1px;
}

/* Table */
.result-table {
  border-top: 1px solid #edf2f7;
  width: 100%;
}

.result-row {
  display: flex;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid #edf2f7;
}

.result-key {
  width: 44%;
  font-size: 0.88rem;
  color: #334155;
  font-weight: 400;
  flex-shrink: 0;
  text-align: left;
}

.result-val {
  width: 56%;
  font-size: 0.88rem;
  color: #0f172a;
  font-weight: 400;
  text-align: left;
  word-break: break-word;
}

/* Error state */
.result-card--error .result-heading {
  color: #1e293b;
}

.result-error-msg {
  text-align: center;
  color: #64748b;
  font-size: 0.92rem;
  margin: 12px 0 24px;
  line-height: 1.6;
}

/* Back home button */
.btn-back-home {
  display: block;
  width: fit-content;
  margin: 0 auto;
  padding: 10px 24px;
  background: #0f172a;
  color: #ffffff;
  border-radius: 99px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: opacity 0.15s ease;
}

.btn-back-home:hover {
  opacity: 0.8;
}

/* Multi-result count */
.result-count {
  text-align: center;
  font-size: 0.85rem;
  color: #94a3b8;
  margin-top: 4px;
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 768px) {
  body {
    background-image: url('image/Mobile_BG.png');
    background-position: center top;
    align-items: flex-start;
    padding-top: calc(max(155px, 20vh));
    padding-bottom: 24px;
  }

  .search-card {
    padding: 46px 22px 44px;
    border-radius: 20px;
    max-width: 380px;
  }

  .card-header {
    margin-bottom: 26px;
  }

  .card-title {
    font-size: 1.35rem;
    line-height: 1.25;
  }

  .card-subtitle {
    font-size: 0.84rem;
    margin-top: 4px;
  }

  .search-section {
    margin-bottom: 0;
  }

  .section-label {
    font-size: 0.85rem;
    margin-bottom: 8px;
  }

  .field {
    padding: 12px 18px;
    font-size: 0.92rem;
  }

  .field-hint {
    font-size: 0.75rem;
    min-height: 0;
    padding: 2px 4px 0;
  }

  .field-hint:empty {
    display: none;
  }

  .input-wrap--stacked {
    margin-top: 8px !important;
  }

  .divider {
    margin: 22px 0;
  }

  .btn-confirm {
    width: 140px;
    padding: 12px 0;
    margin: 16px auto 0;
    font-size: 0.94rem;
  }

  .result-card {
    padding: 22px 18px 22px;
    border-radius: 18px;
  }

  .result-seq-badge {
    font-size: 1.35rem;
  }

  .result-row {
    padding: 8px 0;
  }

  .result-key {
    width: 44%;
    font-size: 0.82rem;
  }

  .result-val {
    width: 56%;
    font-size: 0.82rem;
  }
}