/* index.css — Navy Premium + Glass Card
   ======================================================
   P.V.T. & T. Plas — รับของที่ระลึก
   ดีไซน์: ทันสมัย (Modern)
   พื้นหลังไล่เฉดนุ่ม (gradient mesh) + การ์ดกระจกฝ้า
   ปุ่มไล่เฉดสีมีเงาสี + ไอคอนชิปนุ่ม
====================================================== */

:root {
  --navy: #0f1670;
  --ink: #04113b;

  --accent-1: #0c2bb8;
  --accent-2: #2d60ee;
  --accent-grad: linear-gradient(135deg, var(--accent-1), var(--accent-2));

  --gold: #c46a03;

  --text: #232A3B;
  --muted: #7C8496;
  --muted-soft: #ADB3C2;

  --line: #E9ECF4;

  --field-tint: #F3F5FB;
  --card-bg: rgba(255, 255, 255, 0.88);

  --danger: #E5484D;

  /* ระยะขอบด้านข้างของเนื้อหาภายในการ์ด */
  --card-pad-x: 26px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: "Noto Sans Thai", "Kanit", sans-serif;
  background: #EEF1F8;
  -webkit-font-smoothing: antialiased;
}

button,
input,
a {
  font: inherit;
}

button {
  border: 0;
  background: none;
}

[hidden] {
  display: none !important;
}

/* =========================
   พื้นหลังไล่เฉดนุ่ม (gradient mesh)
========================= */

.page-shell {
  width: 100%;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 30px 16px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(560px 420px at 12% 8%, rgba(12, 43, 184, 0.16), transparent 70%),
    radial-gradient(520px 460px at 88% 18%, rgba(45, 96, 238, 0.14), transparent 70%),
    radial-gradient(600px 480px at 50% 100%, rgba(196, 106, 3, 0.14), transparent 70%);
}

/* =========================
   การ์ดกระจกฝ้า
========================= */

.register-card {
  width: min(100%, 408px);
  position: relative;
  overflow: hidden;
  text-align: center;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: var(--card-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow:
    0 40px 80px -40px rgba(20, 43, 82, 0.35),
    0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.card-body {
  padding: 0 var(--card-pad-x) 28px;
}

/* =========================
   หัวการ์ด / โลโก้
   ขยายพื้นหลังให้เต็มความกว้างด้านบนของการ์ด
========================= */

.brand-header {
  width: calc(100% + (var(--card-pad-x) * 2));
  min-height: 130px;
  margin: 0 calc(var(--card-pad-x) * -1) 24px;
  padding: 28px 20px 24px;
  display: grid;
  place-items: center;
  text-align: center;
  background:
    linear-gradient(
      135deg,
      #002077 0%,
      #0034a5 52%,
      #0072e4 100%
    );
}

.brand-mark {
  width: 100%;
  max-width: 260px;
  height: 86px;
  margin: 0 auto;
  display: grid;
  place-items: center;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.brand-rule {
  width: 40px;
  height: 4px;
  margin: 18px auto 0;
  border-radius: 999px;
  background: var(--accent-grad);
}

h1,
.success-panel h2 {
  margin: 0;
  color: var(--navy);
  font-family: "Kanit", sans-serif;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(23px, 6.6vw, 27px);
}

.success-panel h2 {
  font-size: 21px;
}

.tagline {
  margin: 8px auto 26px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
}

.view-section {
  animation: fadeUp 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========================
   หน้าเลือกวิธี
========================= */

.choice-list {
  display: grid;
  gap: 12px;
}

.choice-button {
  width: 100%;
  min-height: 80px;
  display: grid;
  grid-template-columns: 48px 1fr 20px;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  color: var(--text);
  text-align: left;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  box-shadow: 0 1px 2px rgba(20, 43, 82, 0.04);
}

.choice-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -18px rgba(20, 43, 82, 0.25);
  border-color: rgba(12, 43, 184, 0.25);
}

.choice-button:active {
  transform: translateY(0);
}

.choice-button-primary {
  border-color: transparent;
  background:
    linear-gradient(#fff, #fff) padding-box,
    var(--accent-grad) border-box;
  border: 1.5px solid transparent;
}

.choice-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--accent-1);
  border-radius: 14px;
  background: rgba(12, 43, 184, 0.10);
}

.choice-button-primary .choice-icon {
  color: #fff;
  background: var(--accent-grad);
}

.choice-icon .material-symbols-outlined {
  font-size: 22px;
}

.choice-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.choice-copy strong {
  color: var(--navy);
  font-size: 15px;
  font-weight: 600;
}

.choice-copy small {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.45;
}

.choice-badge {
  grid-column: 2;
  justify-self: start;
  margin-top: 2px;
  padding: 2px 9px;
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  border-radius: 999px;
  background: var(--accent-grad);
}

.choice-arrow {
  color: var(--muted-soft);
  font-size: 18px;
}

.skip-button {
  width: 100%;
  margin-top: 18px;
  padding: 6px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.skip-button:hover {
  color: var(--accent-1);
}

/* =========================
   ปุ่มย้อนกลับ
========================= */

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 14px 0 14px 0;
  padding: 6px 12px 6px 8px;
  color: var(--accent-1);
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  background: rgba(12, 43, 184, 0.08);
  cursor: pointer;
}

.back-button .material-symbols-outlined {
  font-size: 17px;
}

/* =========================
   ฟอร์ม
========================= */

.register-form {
  display: grid;
  gap: 16px;
  text-align: left;
}

.form-group {
  display: grid;
  gap: 7px;
}

.form-group label {
  color: var(--navy);
  font-size: 13px;
  font-weight: 600;
}

.input-wrap {
  position: relative;
}

.input-icon {
  position: absolute;
  top: 50%;
  left: 16px;
  color: var(--muted-soft);
  font-size: 19px;
  transform: translateY(-50%);
  pointer-events: none;
}

.input-wrap input {
  width: 100%;
  min-height: 50px;
  padding: 11px 16px 11px 46px;
  color: var(--text);
  font-size: 15px;
  border: 1.5px solid transparent;
  border-radius: 14px;
  outline: none;
  background: var(--field-tint);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.input-wrap input:focus {
  background: #fff;
  border-color: var(--accent-1);
  box-shadow: 0 0 0 4px rgba(12, 43, 184, 0.12);
}

.input-wrap input.is-invalid {
  border-color: var(--danger);
}

.input-wrap input::placeholder {
  color: var(--muted-soft);
}

.field-error {
  min-height: 16px;
  margin: 0;
  padding-left: 4px;
  color: var(--danger);
  font-size: 11px;
  line-height: 1.4;
}

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.55;
  border-radius: 14px;
  background: var(--field-tint);
  cursor: pointer;
}

.consent-row input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  flex: 0 0 auto;
  accent-color: var(--accent-1);
}

/* =========================
   ถ่ายนามบัตร
========================= */

.upload-area {
  min-height: 200px;
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
  border: 1.5px dashed rgba(12, 43, 184, 0.30);
  border-radius: 18px;
  background: var(--field-tint);
  cursor: pointer;
}

.upload-area input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-placeholder {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 26px 18px;
  text-align: center;
}

.upload-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 25px;
  border-radius: 16px;
  background: var(--accent-grad);
}

.upload-placeholder strong {
  color: var(--navy);
  font-size: 14px;
  font-weight: 600;
}

.upload-placeholder small {
  color: var(--muted);
  font-size: 11.5px;
}

.card-preview {
  width: 100%;
  max-height: 270px;
  display: block;
  object-fit: contain;
  background: #f4f4f4;
}

.secondary-button {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--accent-1);
  font-size: 13.5px;
  font-weight: 600;
  border: 1.5px solid rgba(12, 43, 184, 0.30);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
}

/* =========================
   ปุ่มหลัก — ไล่เฉด + เงาสี
========================= */

.submit-button {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  color: #fff;
  font-size: 15.5px;
  font-weight: 600;
  border-radius: 16px;
  background: var(--accent-grad);
  cursor: pointer;
  box-shadow: 0 16px 30px -14px rgba(12, 43, 184, 0.48);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.submit-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 34px -14px rgba(12, 43, 184, 0.54);
}

.submit-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.skip-note {
  margin: 2px 0 0;
  color: var(--muted-soft);
  font-size: 12px;
  text-align: center;
}

/* =========================
   หน้าสำเร็จ
========================= */

.success-panel {
  padding-top: 6px;
}

.success-icon {
  width: 68px;
  height: 68px;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 20px;
  background: var(--accent-grad);
  box-shadow: 0 16px 30px -14px rgba(12, 43, 184, 0.46);
}

.success-icon .material-symbols-outlined {
  font-size: 34px;
}

.success-panel > p {
  margin: 8px 0 20px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
}

.reference-card {
  margin-bottom: 18px;
  padding: 18px;
  display: grid;
  gap: 5px;
  border-radius: 16px;
  background: var(--field-tint);
}

.reference-label {
  color: var(--muted);
  font-size: 11.5px;
}

.reference-card strong {
  color: var(--navy);
  font-family: "Kanit", sans-serif;
  font-size: 25px;
  font-weight: 600;
  letter-spacing: 1px;
}

.link-hub-button {
  width: 100%;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--navy);
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 600;
  border-radius: 14px;
  border: 1.5px solid var(--line);
  background: #fff;
}

footer {
  margin-top: 22px;
  color: var(--muted-soft);
  font-size: 11px;
}

@media (max-width: 380px) {
  .register-card {
    border-radius: 22px;
  }

  .card-body {
    --card-pad-x: 18px;
    padding-bottom: 22px;
  }
}

@media (min-width: 720px) {
  .page-shell {
    padding-top: 56px;
    padding-bottom: 56px;
  }

  .card-body {
    --card-pad-x: 32px;
    padding-bottom: 32px;
  }
}