/* ==========================================================================
   CÔNG TY CỔ PHẦN NHỰA MINH KHANG - ENTERPRISE ERP AUTHENTICATION SYSTEM
   QUY CHUẨN THIẾT KẾ: SPACING LUÔN LÀ SỐ CHẴN (BỘI SỐ CỦA 2 VÀ 4)
   ========================================================================== */

:root {
  --mk-primary: #0f62fe;
  --mk-primary-hover: #0043ce;
  --mk-primary-light: #edf5ff;
  --mk-secondary: #0043ce;
  --mk-accent: #00d2d3;
  --mk-dark-bg: #070e27;
  --mk-dark-card: #0f1c3f;
  --mk-card-bg: #ffffff;
  --mk-text-main: #0f172a;
  --mk-text-muted: #64748b;
  --mk-text-sub: #94a3b8;
  --mk-border: #e2e8f0;
  --mk-border-focus: #0f62fe;
  --mk-danger: #dc2626;
  --mk-danger-bg: #fef2f2;
  --mk-success: #16a34a;
  --mk-success-bg: #f0fdf4;
  --mk-warning: #d97706;
  --mk-warning-bg: #fffbeb;
  --mk-shadow: 0 20px 48px -12px rgba(15, 23, 42, 0.12);
  --mk-shadow-sm: 0 4px 12px rgba(15, 23, 42, 0.06);
}

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

body.auth-body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: #f1f5f9;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mk-text-main);
  padding: 24px;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Background Ambient Lighting */
.auth-bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: 
    radial-gradient(circle 800px at 10% 10%, rgba(15, 98, 254, 0.08), transparent 70%),
    radial-gradient(circle 600px at 90% 90%, rgba(0, 210, 211, 0.08), transparent 60%),
    radial-gradient(circle 500px at 50% 50%, rgba(99, 102, 241, 0.04), transparent 60%);
}

/* Master Grid Wrapper */
.auth-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1200px;
  min-height: 680px;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: var(--mk-shadow);
  border: 1px solid rgba(226, 232, 240, 0.8);
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  overflow: hidden;
  animation: authAppear 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authAppear {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ==========================================================================
   LEFT SIDE: BRAND HERO PANEL
   ========================================================================== */
.auth-hero-panel {
  background: linear-gradient(145deg, #070e27 0%, #0d1b44 50%, #08102e 100%);
  color: #ffffff;
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.auth-hero-panel::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 98, 254, 0.25) 0%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}

.auth-hero-panel::after {
  content: '';
  position: absolute;
  bottom: -60px;
  left: -60px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 210, 211, 0.2) 0%, transparent 70%);
  filter: blur(36px);
  pointer-events: none;
}

.auth-hero-header {
  position: relative;
  z-index: 2;
}

.auth-brand-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 98, 254, 0.2);
  border: 1px solid rgba(15, 98, 254, 0.4);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #60a5fa;
  margin-bottom: 20px;
  backdrop-filter: blur(8px);
}

.auth-brand-tag i {
  color: #38bdf8;
  font-size: 14px;
}

.auth-hero-title {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.auth-hero-desc {
  font-size: 14px;
  line-height: 1.6;
  color: #94a3b8;
  max-width: 480px;
  margin-bottom: 32px;
}

/* Feature Showcase Grid */
.auth-features-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  position: relative;
  z-index: 2;
  margin-bottom: 32px;
}

.auth-feature-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 16px;
  backdrop-filter: blur(12px);
  transition: all 0.2s ease;
}

.auth-feature-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(15, 98, 254, 0.4);
  transform: translateY(-2px);
}

.auth-feature-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  margin-bottom: 12px;
}

.auth-feature-icon.blue { background: rgba(15, 98, 254, 0.2); color: #60a5fa; }
.auth-feature-icon.green { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.auth-feature-icon.amber { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.auth-feature-icon.purple { background: rgba(139, 92, 246, 0.2); color: #a78bfa; }

.auth-feature-name {
  font-size: 13px;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 4px;
}

.auth-feature-desc {
  font-size: 11px;
  line-height: 1.45;
  color: #94a3b8;
}

/* Hero Footer Status */
.auth-hero-footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: #64748b;
}

.auth-status-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
}

/* ==========================================================================
   RIGHT SIDE: LOGIN FORM PANEL
   ========================================================================== */
.auth-form-panel {
  padding: 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #ffffff;
  overflow-y: auto;
}

.auth-form-header {
  margin-bottom: 24px;
}

.auth-form-header-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.auth-form-logo-box {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0f62fe 0%, #0043ce 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 18px;
  box-shadow: 0 6px 16px rgba(15, 98, 254, 0.28);
}

.auth-company-name {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: 0.4px;
}

.auth-login-title {
  font-size: 24px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.4px;
  margin-bottom: 6px;
}

.auth-login-subtitle {
  font-size: 13px;
  color: var(--mk-text-muted);
}

/* Quick Role Select Section */
.auth-roles-section {
  background: #f8fafc;
  border: 1px solid var(--mk-border);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 24px;
}

.auth-roles-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.auth-roles-label {
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.auth-roles-label i {
  color: var(--mk-primary);
}

.auth-roles-hint {
  font-size: 11px;
  color: #0284c7;
  font-weight: 600;
}

.auth-roles-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.auth-role-pill {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  user-select: none;
}

.auth-role-pill:hover {
  background: var(--mk-primary-light);
  border-color: var(--mk-primary);
  color: var(--mk-primary);
  transform: translateY(-1px);
}

.auth-role-pill.active {
  background: #0f62fe;
  border-color: #0f62fe;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(15, 98, 254, 0.35);
}

/* Alert Boxes */
.auth-alert-box {
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 20px;
  font-size: 13px;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: alertIn 0.25s ease;
}

@keyframes alertIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-alert-box.error {
  background: var(--mk-danger-bg);
  border: 1px solid #fecaca;
  color: var(--mk-danger);
}

.auth-alert-box.success {
  background: var(--mk-success-bg);
  border: 1px solid #bbf7d0;
  color: var(--mk-success);
}

/* Form Controls */
.auth-form-group {
  margin-bottom: 18px;
}

.auth-input-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.auth-field-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-field-icon {
  position: absolute;
  left: 14px;
  color: #94a3b8;
  font-size: 15px;
  pointer-events: none;
  transition: color 0.15s ease;
}

.auth-text-input {
  width: 100%;
  height: 44px;
  padding: 0 14px 0 42px;
  font-size: 14px;
  font-family: inherit;
  color: #0f172a;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  outline: none;
  transition: all 0.15s ease;
}

.auth-text-input:focus {
  border-color: var(--mk-primary);
  box-shadow: 0 0 0 3px rgba(15, 98, 254, 0.15);
}

.auth-text-input:focus + .auth-field-icon,
.auth-field-wrapper:focus-within .auth-field-icon {
  color: var(--mk-primary);
}

.auth-password-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: #94a3b8;
  padding: 6px;
  font-size: 15px;
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.auth-password-toggle:hover {
  color: #334155;
}

/* Form Helper Row */
.auth-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  font-size: 13px;
}

.auth-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: #475569;
  user-select: none;
}

.auth-checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--mk-primary);
  border-radius: 4px;
  cursor: pointer;
}

.auth-forgot-link {
  color: var(--mk-primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s ease;
}

.auth-forgot-link:hover {
  color: var(--mk-primary-hover);
  text-decoration: underline;
}

/* Submit Button */
.auth-submit-button {
  width: 100%;
  height: 48px;
  background: linear-gradient(135deg, #0f62fe 0%, #0043ce 100%);
  border: none;
  border-radius: 12px;
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(15, 98, 254, 0.3);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  letter-spacing: 0.2px;
}

.auth-submit-button:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 20px rgba(15, 98, 254, 0.4);
  background: linear-gradient(135deg, #0050e6 0%, #0036a8 100%);
}

.auth-submit-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(15, 98, 254, 0.3);
}

/* Security Notice Footer */
.auth-security-footer {
  margin-top: 24px;
  text-align: center;
  border-top: 1px solid var(--mk-border);
  padding-top: 18px;
}

.auth-security-text {
  font-size: 12px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.auth-security-text i {
  color: #10b981;
}

/* ==========================================================================
   RESPONSIVE QUERIES
   ========================================================================== */
@media (max-width: 992px) {
  .auth-wrapper {
    grid-template-columns: 1fr;
    max-width: 520px;
    min-height: auto;
  }
  .auth-hero-panel {
    display: none;
  }
  .auth-form-panel {
    padding: 36px 24px;
  }
}

@media (max-width: 480px) {
  body.auth-body {
    padding: 12px;
  }
  .auth-form-panel {
    padding: 28px 18px;
  }
  .auth-login-title {
    font-size: 20px;
  }
  .auth-roles-grid {
    gap: 6px;
  }
  .auth-role-pill {
    padding: 6px 10px;
    font-size: 11px;
  }
}
