/* ============================================================
   style-login.css
   CSS รวมสำหรับหน้า Login + ตั้งรหัสผ่าน
   include('icfiles/style-login.css') หรือ
   <link rel="stylesheet" href="icfiles/style-login.css">
   ============================================================ */

/* ============================================================
   GLOBAL VARIABLES & RESET
   ============================================================ */
:root {
  --sky: #dff2fb;
  --sky-mid: #b3dff5;
  --sky-deep: #7ec8e3;
  --sky-accent: #3aacde;
  --yellow: #fff9d6;
  --yellow-mid: #ffe97a;
  --yellow-accent: #f5c800;
  --yellow-deep: #e0a800;
  --text-dark: #1a2e3b;
  --text-mid: #3d5a6e;
  --text-light: #7a9fb5;
  --white: #ffffff;
  --shadow: 0 20px 60px rgba(58, 172, 222, 0.15);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  background: linear-gradient(135deg, #dff2fb 0%, #eef9ff 40%, #fffef0 70%, #fff9d6 100%);
  min-height: 100%;
  margin: 0;
}

/* ============================================================
   SHARED: PAGE BACKGROUND LAYOUT
   ใช้ได้ทั้ง .login-page-bg และ .setpw-page-bg
   ============================================================ */
.login-page-bg,
.setpw-page-bg {
  min-height: calc(100vh - 120px);
  font-family: 'Sarabun', sans-serif;
  background: linear-gradient(135deg, #dff2fb 0%, #eef9ff 40%, #fffef0 70%, #fff9d6 100%);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 16px 60px;
  position: relative;
  overflow: hidden;
}

/* Decorative blobs */
.login-page-bg::before,
.setpw-page-bg::before {
  content: '';
  position: absolute;
  top: -80px; left: -80px;
  width: 340px; height: 340px;
  background: radial-gradient(circle, rgba(126,200,227,0.35) 0%, transparent 70%);
  border-radius: 50%;
  animation: floatBlob 8s ease-in-out infinite;
  pointer-events: none;
}

.login-page-bg::after,
.setpw-page-bg::after {
  content: '';
  position: absolute;
  bottom: -60px; right: -60px;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(245,200,0,0.22) 0%, transparent 70%);
  border-radius: 50%;
  animation: floatBlob 10s ease-in-out infinite reverse;
  pointer-events: none;
}

.blob-mid {
  position: absolute;
  top: 40%; right: -60px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(126,200,227,0.18) 0%, transparent 70%);
  border-radius: 50%;
  animation: floatBlob 12s ease-in-out infinite 2s;
  pointer-events: none;
}

@keyframes floatBlob {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-24px) scale(1.04); }
}

/* Decorative dots */
.deco-stars { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.star {
  position: absolute;
  border-radius: 50%;
  animation: twinkle 4s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 0.9; transform: scale(1.4); }
}

/* ============================================================
   SHARED: CARD BASE
   ============================================================ */
.login-card,
.setpw-card {
  background: rgba(255,255,255,0.84);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.9);
  border-radius: 28px;
  max-width: 100%;
  box-shadow: var(--shadow), 0 1px 0 rgba(255,255,255,0.8) inset;
  position: relative;
  z-index: 10;
  animation: slideUp 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
  overflow: hidden;
}

.login-card { width: 420px; }
.setpw-card { width: 480px; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(32px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================================
   SHARED: CARD HEADER STRIP
   ============================================================ */
.card-header-strip,
.setpw-header {
  background: linear-gradient(135deg, var(--sky-accent) 0%, var(--sky-deep) 100%);
  padding: 32px 36px 28px;
  position: relative;
  overflow: hidden;
}

.card-header-strip::before,
.setpw-header::before {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 120px; height: 120px;
  background: rgba(255,255,255,0.12);
  border-radius: 50%;
}

.card-header-strip::after,
.setpw-header::after {
  content: '';
  position: absolute;
  bottom: -20px; right: 40px;
  width: 80px; height: 80px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}

/* SHARED: Icon wrap */
.icon-wrap,
.setpw-icon-wrap {
  background: rgba(255,255,255,0.22);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  border: 1.5px solid rgba(255,255,255,0.35);
}
.icon-wrap { width: 64px; height: 64px; }
.icon-wrap svg { width: 32px; height: 32px; fill: white; }
.setpw-icon-wrap { width: 56px; height: 56px; border-radius: 16px; margin-bottom: 14px; }
.setpw-icon-wrap svg { width: 28px; height: 28px; fill: white; }

/* SHARED: Badge */
.badge-strip,
.setpw-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--yellow-accent);
  color: var(--text-dark);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 99px;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

/* SHARED: Card title */
.card-header-strip h4,
.setpw-header h4 {
  font-family: 'Prompt', sans-serif;
  font-size: 1.4rem;
  font-weight: 600;
  color: white;
  line-height: 1.3;
  position: relative;
  z-index: 1;
  margin: 0;
}
.setpw-header h4 { font-size: 1.25rem; }

.card-header-strip p,
.setpw-header p {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.8);
  margin-top: 4px;
  position: relative;
  z-index: 1;
}

/* ============================================================
   SHARED: CARD BODY
   ============================================================ */
.card-body-form,
.setpw-body {
  padding: 32px 36px 36px;
}

/* SHARED: Form groups */
.form-group-c,
.setpw-form-group { margin-bottom: 22px; }

/* SHARED: Labels — scoped เฉพาะใน card เพื่อไม่กระทบ navbar */
.card-body-form label,
.setpw-body label,
.setpw-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-mid);
  margin-bottom: 8px;
  letter-spacing: 0.2px;
}

/* SHARED: Input wrap */
.input-wrap,
.setpw-input-wrap { position: relative; }

/* SHARED: Input icons */
.input-icon,
.setpw-input-icon {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--sky-accent);
  width: 18px; height: 18px;
  pointer-events: none;
}

/* SHARED: Inputs */
input[type="number"],
input[type="password"],
input[type="text"],
.setpw-input {
  width: 100%;
  padding: 13px 16px 13px 44px;
  border: 1.8px solid var(--sky-mid);
  border-radius: 14px;
  font-family: 'Sarabun', sans-serif;
  font-size: 0.95rem;
  color: var(--text-dark);
  background: rgba(255,255,255,0.9);
  transition: all 0.25s ease;
  outline: none;
  -moz-appearance: textfield;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button,
.setpw-input::-webkit-inner-spin-button,
.setpw-input::-webkit-outer-spin-button { -webkit-appearance: none; }

input:focus,
.setpw-input:focus {
  border-color: var(--sky-accent);
  background: white;
  box-shadow: 0 0 0 4px rgba(58,172,222,0.12);
  transform: translateY(-1px);
}
input::placeholder,
.setpw-input::placeholder { color: var(--text-light); }

/* SHARED: Password toggle button */
.toggle-pw,
.setpw-toggle-pw {
  position: absolute;
  right: 14px; top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--text-light);
  transition: color 0.2s;
  background: none;
  border: none;
  padding: 4px;
  display: flex;
  align-items: center;
}
.toggle-pw:hover,
.setpw-toggle-pw:hover { color: var(--sky-accent); }

/* SHARED: Divider */
.divider,
.setpw-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--sky-mid), transparent);
  margin: 24px 0;
}

/* SHARED: Primary button */
.btn-login,
.setpw-btn-submit {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, var(--sky-accent) 0%, #2196c4 100%);
  color: white;
  border: none;
  border-radius: 14px;
  font-family: 'Prompt', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  letter-spacing: 0.3px;
  box-shadow: 0 6px 24px rgba(58,172,222,0.4);
}
.btn-login::before,
.setpw-btn-submit::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s ease;
}
.btn-login:hover,
.setpw-btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(58,172,222,0.5);
}
.btn-login:hover::before,
.setpw-btn-submit:hover::before { left: 100%; }
.btn-login:active,
.setpw-btn-submit:active { transform: translateY(0); }

/* SHARED: Dot accent */
.dot-accent,
.setpw-dot {
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--yellow-accent);
  border-radius: 50%;
  margin-right: 4px;
}

/* ============================================================
   LOGIN PAGE ONLY
   ============================================================ */
.hint-note {
  text-align: center;
  margin-top: 18px;
  font-size: 0.8rem;
  color: var(--text-light);
}
.hint-note a {
  color: var(--sky-accent);
  text-decoration: none;
  font-weight: 600;
}
.hint-note a:hover { text-decoration: underline; }

/* Facebook button */
.fb-link-wrap {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(179,223,245,0.4);
}
.btn-facebook {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 11px 16px;
  background: rgba(24,119,242,0.07);
  border: 1.5px solid rgba(24,119,242,0.2);
  border-radius: 12px;
  color: #1877f2;
  font-family: 'Sarabun', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.25s ease;
}
.btn-facebook:hover {
  background: rgba(24,119,242,0.13);
  border-color: rgba(24,119,242,0.4);
  color: #1877f2;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(24,119,242,0.15);
  text-decoration: none;
}

/* ============================================================
   SET PASSWORD PAGE ONLY
   ============================================================ */

/* 2-column form row */
.setpw-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 18px;
}
@media (max-width: 520px) {
  .setpw-form-row { grid-template-columns: 1fr; }
}

/* Section label */
.setpw-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--sky-accent);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.setpw-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--sky-mid), transparent);
}

/* Info note box */
.setpw-info-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(58,172,222,0.07);
  border: 1px solid rgba(58,172,222,0.18);
  border-radius: 11px;
  padding: 11px 14px;
  margin-bottom: 20px;
  font-size: 0.8rem;
  color: var(--text-mid);
  line-height: 1.5;
}
.setpw-info-note svg {
  width: 16px; height: 16px;
  color: var(--sky-accent);
  flex-shrink: 0;
  margin-top: 1px;
}

/* Input with toggle padding */
.setpw-input.has-toggle { padding-right: 44px; }

/* Step indicator */
.setpw-steps {
  display: flex;
  align-items: center;
  margin-top: 18px;
  position: relative;
  z-index: 1;
}
.setpw-step {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(255,255,255,0.6);
}
.setpw-step.active { color: white; }
.setpw-step-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  border: 1.5px solid rgba(255,255,255,0.3);
  flex-shrink: 0;
}
.setpw-step.active .setpw-step-num {
  background: var(--yellow-accent);
  color: var(--text-dark);
  border-color: var(--yellow-accent);
}
.setpw-step-line {
  width: 28px; height: 1.5px;
  background: rgba(255,255,255,0.25);
  margin: 0 4px;
}

/* Back link */
.setpw-back-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 16px;
  font-size: 0.8rem;
  color: var(--text-light);
  text-decoration: none;
  transition: color 0.2s;
}
.setpw-back-link:hover { color: var(--sky-accent); }
.setpw-back-link svg { width: 14px; height: 14px; }