/* ================= RESET ================= */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Arial;
  background: linear-gradient(135deg, #1f1f1f, #0d0d0d);
  color: #ffffff;
  overflow-x: hidden;
}

/* ป้องกันมือถือซูม */
input, select, textarea, button {
  font-size: 16px;
}

/* ================= TOKENS ================= */
:root {
  --ci-yellow: #ffc502;
  --ci-gray: #575757;
  --ci-dark: #111111;
  --ci-card: #151515;
  --ci-border: rgba(255,255,255,.08);
  --ci-text-soft: #bdbdbd;
}

/* ================= APP WRAP ================= */
body {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 16px;
}

#app{
  min-height:100vh;
  width:100%;
  max-width:420px;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
  padding-top:24px; /* กัน layout ลอยหลังลบโลโก้ */
}

/* ================= CARD ================= */
.card {
  width: 100%;
  max-width: 420px;
  background: var(--ci-card);
  border-radius: 22px;
  padding: 20px 24px 26px;
  box-shadow: 0 30px 60px rgba(0,0,0,.6);
  animation: fadeIn .25s ease;
  position: relative;
}

/* ================= FORM BASE ================= */
.field { margin-top: 12px; }

.field label {
  display: block;
  font-size: 12px;
  color: var(--ci-text-soft);
  margin-bottom: 6px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--ci-border);
  background: #0f0f0f;
  color: #ffffff;
  font-size: 15px;
}

.field textarea {
  resize: vertical;
  min-height: 80px;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #777;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--ci-yellow);
}

/* ================= GRID ================= */
.form-grid-2{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}

.form-grid-3{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:12px;
}

.field.full{
  grid-column:1 / -1;
}

/* ================= SOCIAL SECTION ================= */
.social-section{
  background: rgba(255,255,255,0.05);
  border-radius:16px;
  padding:16px;
  margin:20px 0;
}

.social-section .section-title{
  font-size:14px;
  font-weight:600;
  margin-top: 0px;
  color:#ffffff;
  margin-bottom:12px;
}

/* grid 2 คอลัมน์ */
.social-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}

/* ช่องเต็มแถว */
.social-grid .full{
  grid-column:1 / -1;
}

/* label + icon */
.label-with-icon{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:13px;
  font-weight:600;
  color:#ffffff;
  margin-bottom:6px;
}

.label-with-icon .icon{
  width:16px;
  height:16px;
  object-fit:contain;
}

/* ================= SELECT CARD ================= */
.select-grid{
  display:grid;
  grid-template-columns: repeat(2,1fr);
  gap:10px;
}

.select-grid.small{
  grid-template-columns:repeat(3,1fr);
  gap:8px;
}

.select-card{
  padding:12px 10px;
  border-radius:14px;
  background:#1a1a1a;
  border:1px solid rgba(255,255,255,.08);
  cursor:pointer;
  font-size:14px;
  transition:.15s;
}

.select-card.active{
  background:#ffc50222;
  border-color:#ffc502;
  color:#ffc502;
}

.select-grid.small .select-card{
  padding:8px 6px;
  font-size:12px;
  border-radius:10px;
}

/* ================= BUTTON ================= */
.btn {
  width: 100%;
  margin-top: 18px;
  padding: 14px;
  border: none;
  border-radius: 14px;
  background: var(--ci-yellow);
  color: #000000;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: all .15s ease;
}

.btn:hover { background: #ffd84a; }
.btn:disabled { background: #777; cursor: not-allowed; }

.btn.secondary {
  background: #2a2a2a;
  color: #ffffff;
}
.btn.secondary:hover { background: #333; }

.btn.danger {
  background: #ef4444;
  color: #ffffff;
}
.btn.danger:hover { background: #dc2626; }

/* ปุ่มเรียงแถวเดียว */
.form-actions{
  display:flex;
  gap:12px;
}
.form-actions .btn{ flex:1; }

.btn-row{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
  margin-top:20px;
}

/* ================= TITLES ================= */
h3 {
  margin: 18px 0 6px;
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
}

.section-title {
  font-size: 13px;
  color: var(--ci-text-soft);
  margin-bottom: 14px;
}

/* ================= PROFILE MINI ================= */
.profile {
  text-align: center;
  margin-bottom: 18px;
}

.profile img {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 8px;
  border: 2px solid var(--ci-border);
}

.profile h2 {
  margin: 6px 0 2px;
  font-size: 19px;
  font-weight: 700;
}

.profile p {
  margin: 0;
  font-size: 12px;
  color: var(--ci-text-soft);
  word-break: break-all;
}

/* ================= PROFILE PAGE ================= */
.profile-page { max-width: 100%; }

.profile-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.profile-header img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--ci-border);
}

.profile-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.profile-header p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--ci-text-soft);
}

/* ================= INFO GRID ================= */
.section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--ci-border);
}

.section h3 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 700;
}

.info-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.info-row span {
  font-size: 13px;
  color: var(--ci-text-soft);
}

/* readonly inputs */
.profile-page input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 14px;
  background: transparent;
  color: #ffffff;
}

.profile-page input:disabled {
  background: #0f0f0f;
}

/* ================= WIZARD HEADER ================= */
.wizard-header { margin-bottom: 18px; }

.step-indicator {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.step-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #2a2a2a;
  color: #aaa;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

.step-dot.active {
  background: var(--ci-yellow);
  color: #000000;
}

.step-dot.done {
  background: #16a34a;
  color: #ffffff;
}

/* ================= PROGRESS ================= */
.progress-wrap {
  width: 100%;
  height: 6px;
  background: #2a2a2a;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--ci-yellow), #ffe38a);
  transition: width .25s ease;
}

/* ================= SUCCESS ================= */
.success {
  text-align: center;
  padding: 32px 10px;
}

.success h2 {
  margin-bottom: 6px;
  font-size: 22px;
  color: var(--ci-yellow);
}

.success p {
  font-size: 14px;
  color: var(--ci-text-soft);
}

/* ล็อกขนาดทุก step ให้คงที่ */
#step1,
#step2,
#step3,
#profileViewBox,
#successBox{
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

/* ล็อก card ไม่ให้เปลี่ยนขนาดตามเนื้อหา */
.card{
  width: 100%;
  max-width: 420px;
  min-height: 520px;
}

/* ================= ANIM ================= */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ================= MOBILE ================= */
@media (max-width: 640px){
  .form-grid-2{
    grid-template-columns: 1fr 1fr; 
    gap: 10px;
  }
  .social-grid{
    grid-template-columns: 1fr 1fr; 
  }
}

@media (max-width: 480px){

  body { padding: 10px; }

  .card {
    max-width: 100%;
    padding: 20px 18px 22px;
    border-radius: 18px;
  }

  .birthday-group{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:10px;
  }

  select{
    appearance:none;
    -webkit-appearance:none;
  }

  input, select, textarea, button {
    min-height:44px;
  }
}

/* ================= STICKY ACTION BAR ================= */
.sticky-actions{
  position: sticky;
  bottom: 0;
  background: linear-gradient(
    to top,
    rgba(13,13,13,0.95),
    rgba(13,13,13,0.85),
    rgba(13,13,13,0.0)
  );
  padding: 16px 0 10px;
  margin-top: 24px;

  display: flex;
  gap: 12px;
}

.sticky-actions .btn{
  flex: 1;
}

#step1,
#step2,
#step3{
  padding-bottom: 90px;
}