/* ================================================
   WARZ SERVER — Auth CSS (Split Layout)
   ================================================ */

@import url('https://fonts.googleapis.com/css2?family=Kanit:wght@300;400;600;700;900&display=swap');

:root {
  --red:        #e8001a;
  --red-dark:   #b00014;
  --red-glow:   rgba(232, 0, 26, 0.45);
  --red-dim:    rgba(232, 0, 26, 0.1);
  --dark:       #060608;
  --dark-2:     #0e0e12;
  --dark-3:     #16161c;
  --border:     rgba(255,255,255,0.06);
  --border-red: rgba(232,0,26,0.28);
  --text:       #c8c8d4;
  --muted:      #4a4a58;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Body ── */
.auth-body {
  font-family: 'Kanit', sans-serif;
  min-height: 100vh;
  background: var(--dark);
  overflow: hidden;
}

/* ── Background layer ── */
.auth-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.auth-bg__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(232,0,26,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232,0,26,0.04) 1px, transparent 1px);
  background-size: 56px 56px;
}

.auth-bg__glow {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 900px; height: 500px;
  background: radial-gradient(ellipse, rgba(232,0,26,0.07) 0%, transparent 70%);
  filter: blur(60px);
}

/* Animated scan line */
.auth-bg__lines {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.auth-bg__lines::after {
  content: '';
  position: absolute;
  top: -100%;
  left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(232,0,26,0.4), transparent);
  animation: scanLine 6s linear infinite;
}
@keyframes scanLine {
  0%   { top: -2px; }
  100% { top: 100%; }
}

/* ── Split container ── */
.auth-split {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

.auth-split--reverse {
  direction: rtl;
}
.auth-split--reverse > * {
  direction: ltr;
}

/* ── Left panel (branding) ── */
.auth-panel--left {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-panel__bg-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.22) saturate(0.6);
  z-index: 0;
}

.auth-panel__inner {
  position: relative;
  z-index: 1;
  padding: 60px 48px;
  display: flex;
  flex-direction: column;
  gap: 40px;
  width: 100%;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.auth-logo__img {
  height: 44px;
  width: auto;
  filter: drop-shadow(0 0 10px var(--red-glow));
}

.auth-logo__text {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #fff;
  text-transform: uppercase;
}
.auth-logo__text span { color: var(--red); }

.auth-panel__tagline h1 {
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: 0.02em;
  color: #fff;
  text-transform: uppercase;
}

.auth-panel__tagline p {
  margin-top: 14px;
  font-size: 15px;
  font-weight: 300;
  color: var(--text);
  line-height: 1.7;
  max-width: 320px;
}

/* Perks list (register page) */
.auth-perks {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-perks li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
}
.auth-perks li i {
  color: var(--red);
  font-size: 13px;
  flex-shrink: 0;
}

/* Decorative divider */
.auth-panel__deco {
  display: flex;
  align-items: center;
  gap: 10px;
}
.deco-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-red));
}
.deco-dot {
  width: 6px; height: 6px;
  background: var(--red);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--red-glow);
}

/* Vertical red accent bar on inner edge */
.auth-panel--left::after {
  content: '';
  position: absolute;
  top: 10%; bottom: 10%;
  right: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--red), transparent);
  z-index: 2;
}

/* ── Right panel (form) ── */
.auth-panel--right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
  background: var(--dark-2);
}

.auth-form-wrap {
  width: 100%;
  max-width: 400px;
  animation: authFadeUp 0.55s cubic-bezier(0.4,0,0.2,1) both;
}

@keyframes authFadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-form-header {
  margin-bottom: 36px;
}

.auth-form-header h2 {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  position: relative;
  display: inline-block;
  padding-bottom: 12px;
}

/* Red underline accent */
.auth-form-header h2::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 40px; height: 3px;
  background: var(--red);
  box-shadow: 0 0 10px var(--red-glow);
}

.auth-form-header p {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}

/* ── Form ── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Field ── */
.auth-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.auth-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-label-hint {
  font-size: 11px;
  color: #22c55e;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: none;
}

/* ── Input ── */
.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-icon {
  position: absolute;
  left: 14px;
  font-size: 13px;
  color: var(--muted);
  pointer-events: none;
  transition: color 0.2s;
  z-index: 1;
}

.auth-input {
  width: 100%;
  background: var(--dark-3);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 13px 14px 13px 42px;
  color: #fff;
  font-family: 'Kanit', sans-serif;
  font-size: 14px;
  font-weight: 300;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  /* Parallelogram cut */
  clip-path: polygon(8px 0%, 100% 0%, calc(100% - 8px) 100%, 0% 100%);
}

.auth-input::placeholder { color: var(--muted); }

.auth-input:focus {
  border-color: var(--red);
  background: rgba(232,0,26,0.04);
  box-shadow: 0 0 0 3px rgba(232,0,26,0.1);
}

.auth-input-wrap:focus-within .auth-input-icon { color: var(--red); }

/* Password toggle */
.auth-toggle-pw {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  padding: 4px;
  transition: color 0.2s;
  z-index: 1;
}
.auth-toggle-pw:hover { color: #fff; }

/* OTP send button */
.auth-otp-send {
  position: absolute;
  right: 8px;
  background: transparent;
  border: 1px solid var(--border-red);
  color: var(--red);
  font-family: 'Kanit', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 12px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
  clip-path: polygon(4px 0%, 100% 0%, calc(100% - 4px) 100%, 0% 100%);
  z-index: 1;
}
.auth-otp-send:hover { background: var(--red); color: #fff; }
.auth-otp-send:disabled { opacity: 0.4; cursor: not-allowed; }

/* OTP input */
.auth-input--otp {
  letter-spacing: 0.5em;
  font-size: 20px;
  font-weight: 600;
  text-align: center;
  padding-left: 42px;
}

/* ── Password strength ── */
.auth-strength {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}
.auth-strength span {
  flex: 1;
  height: 3px;
  background: var(--border);
  transition: background 0.3s;
}
.auth-strength.s1 span:nth-child(1)    { background: #e8001a; }
.auth-strength.s2 span:nth-child(-n+2) { background: #f97316; }
.auth-strength.s3 span:nth-child(-n+3) { background: #eab308; }
.auth-strength.s4 span                 { background: #22c55e; }

/* ── Match message ── */
.auth-match-msg {
  font-size: 11px;
  font-weight: 400;
  min-height: 16px;
  margin-top: 2px;
}
.auth-match-msg.ok    { color: #22c55e; }
.auth-match-msg.error { color: var(--red); }

/* ── Row ── */
.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: -4px;
  font-size: 13px;
  color: var(--muted);
}

/* Custom checkbox */
.auth-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
.auth-check input { display: none; }
.auth-check__box {
  width: 16px; height: 16px;
  border: 1px solid var(--border-red);
  background: var(--dark-3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}
.auth-check input:checked ~ .auth-check__box { background: var(--red); border-color: var(--red); }
.auth-check__box::after {
  content: '';
  width: 8px; height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
  opacity: 0;
  transition: opacity 0.15s;
}
.auth-check input:checked ~ .auth-check__box::after { opacity: 1; }

/* ── Links ── */
.auth-link {
  color: var(--red);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.2s;
}
.auth-link:hover { color: #ff4d5e; }
.auth-link--sm { font-size: 12px; }

/* ── Submit button ── */
.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px;
  background: var(--red);
  border: none;
  color: #fff;
  font-family: 'Kanit', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  clip-path: polygon(12px 0%, 100% 0%, calc(100% - 12px) 100%, 0% 100%);
  position: relative;
  overflow: hidden;
  transition: background 0.2s, box-shadow 0.2s;
  margin-top: 8px;
}

/* Shimmer */
.auth-btn::after {
  content: '';
  position: absolute;
  top: 0; left: -80%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
  transform: skewX(-20deg);
  transition: left 0.5s;
}
.auth-btn:hover { background: #ff1a34; box-shadow: 0 0 30px rgba(232,0,26,0.5); }
.auth-btn:hover::after { left: 130%; }
.auth-btn.loading { pointer-events: none; opacity: 0.7; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .auth-split {
    grid-template-columns: 1fr;
  }
  .auth-panel--left {
    display: none;
  }
  .auth-split--reverse {
    direction: ltr;
  }
  .auth-panel--right {
    min-height: 100vh;
    padding: 48px 24px;
  }
  .auth-form-wrap {
    max-width: 100%;
  }
}

.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 400;
  transition: color 0.2s, gap 0.2s;
}
.auth-back i { font-size: 11px; transition: transform 0.2s; }
.auth-back:hover { color: var(--text); }
.auth-back:hover i { transform: translateX(-3px); }
