/* ============================================================
   SALESUPPORT — Auth Pages CSS
   ============================================================
   ไฟล์นี้เก็บ style สำหรับหน้า login, register, forgot-password
   ใช้กับ layout: 'blank' (ไม่มี sidebar/topbar)

   👤 ใครแก้ได้: แอดมินระบบ
   🎯 แก้ทำไม: ปรับรูปลักษณ์ของหน้า auth
   ============================================================ */

/* ============================================================
   1. Auth Layout — Split screen (branding | form)
   ============================================================ */

.auth-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--color-bg);
}

/* พื้นที่ฝั่งซ้าย — branding + quote */
.auth-branding {
  background: linear-gradient(135deg, var(--color-emerald-600) 0%, var(--color-emerald-700) 100%);
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--space-12);
  position: relative;
  overflow: hidden;
}

.auth-branding::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-full);
}

.auth-branding::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 400px;
  height: 400px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-full);
}

/* โลโก้ + ชื่อแบรนด์ */
.auth-branding-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  position: relative;
  z-index: 1;
}

.auth-branding-logo {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-bold);
  font-size: var(--text-lg);
  backdrop-filter: blur(10px);
}

.auth-branding-name {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  letter-spacing: 0.02em;
}

/* คำคม / tagline ตรงกลาง */
.auth-branding-quote {
  position: relative;
  z-index: 1;
  max-width: 480px;
}

.auth-branding-quote h2 {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: white;
  margin-bottom: var(--space-4);
  line-height: 1.3;
}

.auth-branding-quote p {
  font-size: var(--text-base);
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.6;
}

/* ด้านล่าง — feature list */
.auth-branding-features {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.auth-feature {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: rgba(255, 255, 255, 0.9);
  font-size: var(--text-sm);
}

.auth-feature-icon {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ด้านล่างสุด — copyright */
.auth-branding-footer {
  position: relative;
  z-index: 1;
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.6);
}


/* ============================================================
   2. Form Side — ฝั่งขวา
   ============================================================ */

.auth-form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-12);
}

.auth-form-container {
  width: 100%;
  max-width: 400px;
}

.auth-form-header {
  margin-bottom: var(--space-8);
}

.auth-form-title {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--color-heading);
  margin-bottom: var(--space-2);
}

.auth-form-subtitle {
  font-size: var(--text-sm);
  color: var(--color-secondary);
}

/* Form เอง */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* ช่อง input + icon */
.auth-input-group {
  position: relative;
}

.auth-input-group .icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-muted);
  pointer-events: none;
}

.auth-input-group .form-control {
  padding-left: calc(var(--space-8) + var(--space-2));
}

/* ปุ่ม toggle รหัสผ่าน */
.auth-input-group .password-toggle {
  position: absolute;
  right: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-muted);
  cursor: pointer;
  padding: var(--space-1);
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
}

.auth-input-group .password-toggle:hover {
  color: var(--color-text);
}

/* แถว "จดจำรหัสผ่าน" + "ลืมรหัสผ่าน" */
.auth-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-2);
}

.auth-form-row .form-check {
  font-size: var(--text-sm);
  color: var(--color-secondary);
}

.auth-form-row a {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
}

/* ปุ่ม submit เต็มความกว้าง */
.auth-form .btn-primary {
  width: 100%;
  padding: var(--space-3);
  margin-top: var(--space-2);
}

/* ตัวคั่น "หรือ" */
.auth-divider {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: var(--space-6) 0;
  color: var(--color-muted);
  font-size: var(--text-xs);
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

/* ลิงก์ด้านล่าง — สมัครสมาชิก */
.auth-form-footer {
  text-align: center;
  margin-top: var(--space-6);
  font-size: var(--text-sm);
  color: var(--color-secondary);
}

.auth-form-footer a {
  font-weight: var(--font-medium);
}

/* ข้อความแจ้งเตือน (success/error banner) */
.auth-alert {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.auth-alert-success {
  background: var(--color-success-bg);
  color: var(--color-success-text);
}

.auth-alert-error {
  background: var(--color-error-bg);
  color: var(--color-error-text);
}

.auth-alert-info {
  background: var(--color-info-bg);
  color: var(--color-info-text);
}


/* ============================================================
   3. Responsive — มือถือซ่อนฝั่ง branding
   ============================================================ */

@media (max-width: 768px) {
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .auth-branding {
    display: none;
  }

  .auth-form-side {
    padding: var(--space-6);
  }
}

@media (max-width: 480px) {
  .auth-form-side {
    padding: var(--space-4);
    align-items: flex-start;
    padding-top: var(--space-12);
  }
}
