/* ============================================
   ATG HubPay — Auth Page Styles
   ============================================ */

body.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 16% 8%, rgba(244, 221, 176, 0.16), transparent 30%),
    radial-gradient(circle at 86% 18%, rgba(126, 161, 132, 0.18), transparent 30%),
    var(--bg);
}

.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 24px 48px;
  position: relative;
  overflow: hidden;
}

.auth-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.auth-bg .blob-1 {
  width: 500px; height: 500px;
  background: var(--primary);
  top: -150px; right: -100px;
  opacity: 0.16;
}
.auth-bg .blob-2 {
  width: 350px; height: 350px;
  background: var(--accent);
  bottom: -100px; left: -80px;
  opacity: 0.14;
}

/* ── Card ── */
.auth-card {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.055)),
    rgba(18, 31, 28, 0.58);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 40px;
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-lg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  animation: slideUp 0.4s cubic-bezier(0.4,0,0.2,1);
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-logo {
  font-size: 28px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #f4ddb0 0%, #d4b178 55%, #7ea184 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.auth-logo .logo-accent {
  font-weight: 300;
  letter-spacing: 0.5px;
  background: none;
  -webkit-background-clip: initial;
  background-clip: initial;
  -webkit-text-fill-color: rgba(226,232,240,0.8);
}

/* ── Tabs ── */
.auth-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 244, 222, 0.1);
  border-radius: 100px;
  padding: 4px;
  margin-bottom: 28px;
  gap: 4px;
}
.auth-tab {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: 100px;
  padding: 10px;
  font-family: 'Nunito', 'Noto Sans Thai', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text3);
  cursor: pointer;
  transition: var(--transition);
}
.auth-tab.active {
  background: linear-gradient(135deg, #d4b178 0%, #a17946 100%);
  color: #1c1409;
  box-shadow: 0 8px 18px rgba(128, 87, 35, 0.26);
}

/* ── Form ── */
.auth-form { display: none; }
.auth-form.active { display: block; }

.auth-subtitle {
  font-size: 14px;
  color: var(--text2);
  text-align: center;
  margin-bottom: 24px;
  font-weight: 300;
}

.form-group {
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  margin-bottom: 8px;
}
.form-group input {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text);
  font-family: 'Nunito', 'Noto Sans Thai', sans-serif;
  font-size: 15px;
  transition: var(--transition);
  outline: none;
}
.form-group input:focus {
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 3px rgba(212,177,120,0.14);
}
.form-group input.error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.1);
}
.field-error {
  display: block;
  font-size: 12px;
  color: #ef4444;
  margin-top: 5px;
  min-height: 16px;
}

.input-wrap {
  position: relative;
}
.input-wrap input { padding-right: 48px; }
.toggle-pw {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text3);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}
.toggle-pw:hover { color: var(--text); }

/* Password strength */
.pw-strength {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.pw-bar {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.pw-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  transition: width 0.3s, background 0.3s;
}
#pwLabel { font-size: 11px; color: var(--text3); min-width: 40px; }

/* Checkbox row */
.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  margin-top: -6px;
}
.checkbox-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text2);
}
.checkbox-wrap input[type="checkbox"] { display: none; }
.checkmark {
  width: 18px; height: 18px;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}
.checkbox-wrap input:checked ~ .checkmark {
  background: linear-gradient(135deg, #d4b178 0%, #a17946 100%);
  border-color: var(--primary);
}
.checkbox-wrap input:checked ~ .checkmark::after {
  content: '✓';
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.forgot-link {
  font-size: 13px;
  color: var(--primary);
  text-decoration: none;
}
.forgot-link:hover { text-decoration: underline; }

/* Form-level error */
.form-error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: #fca5a5;
  margin-bottom: 16px;
  display: none;
}
.form-error.show { display: block; }

/* Full-width button */
.btn-full {
  width: 100%;
  justify-content: center;
  border-radius: var(--radius-sm);
  position: relative;
}

/* Spinner inside button */
.btn-spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255, 244, 222, 0.28);
  border-top-color: #1c1409;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
  box-shadow: 0 0 18px rgba(212, 177, 120, 0.16);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Divider */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text3);
  font-size: 13px;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Discord button */
.btn-discord {
  width: 100%;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.045)),
    rgba(18, 31, 28, 0.58);
  color: var(--text);
  border: 1px solid rgba(255, 244, 222, 0.16);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-family: 'Nunito', 'Noto Sans Thai', sans-serif;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: var(--transition);
}
.btn-discord:hover {
  background: rgba(212, 177, 120, 0.12);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(128, 87, 35, 0.22);
  border-color: rgba(255, 244, 222, 0.3);
}

.auth-switch {
  text-align: center;
  font-size: 13px;
  color: var(--text2);
  margin-top: 20px;
  display: flex;
  gap: 6px;
  justify-content: center;
}
.auth-switch a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}
.auth-switch a:hover { text-decoration: underline; }

/* ── Inner pages (cart, etc.) ── */
body.inner-page { padding-top: 72px; }

/* ── Auth Responsive ── */
@media (max-width: 600px) {
  .auth-main { padding: 80px 16px 40px; }
  .auth-card {
    padding: 28px 20px;
    border-radius: 16px;
    width: 100%;
  }
  .auth-title { font-size: 22px; }
  .auth-sub   { font-size: 13px; }
  .auth-input { height: 44px; font-size: 14px; }
  .auth-btn   { height: 44px; font-size: 15px; }
  .discord-btn { height: 44px; font-size: 14px; }
  .auth-bg .blob-1,
  .auth-bg .blob-2 { display: none; }
}
@media (max-width: 400px) {
  .auth-card { padding: 24px 16px; }
  .auth-title { font-size: 20px; }
}

/* Google button */
.btn-google {
  width: 100%;
  background: rgba(255, 255, 255, 0.9);
  color: #3c4043;
  border: 1.5px solid #dadce0;
  border-radius: var(--radius-sm);
  padding: 11px 20px;
  font-family: 'Nunito', 'Noto Sans Thai', sans-serif;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: var(--transition);
  margin-bottom: 10px;
}
.btn-google:hover {
  background: #f8f9fa;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
  transform: translateY(-1px);
}

/* OTP panel */
.otp-email-hint {
  font-size: 13px;
  color: var(--text2);
  text-align: center;
  margin: -8px 0 20px;
  word-break: break-all;
}
.otp-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  font-size: 13px;
}
.otp-actions a {
  color: var(--text2);
  text-decoration: none;
  transition: color .2s;
}
.otp-actions a:hover { color: var(--primary); }

/* Toast */
#toast.show { opacity: 1 !important; }

/* ============================================
   Light Theme Overrides — Auth Page
   ============================================ */

html[data-atg-theme="light"] .auth-card {
  background: #ffffff;
  border-color: rgba(86, 65, 37, 0.12);
  box-shadow: 0 8px 32px rgba(62, 45, 24, 0.10), inset 0 1px 0 rgba(255, 255, 255, 1);
}

html[data-atg-theme="light"] .otp-card {
  background: #ffffff;
  border-color: rgba(86, 65, 37, 0.12);
  box-shadow: 0 8px 32px rgba(62, 45, 24, 0.10);
}
