/* ===== NexHome Auth Pages ===== */

/* Split Layout (Login & Register) */
.auth-split {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Brand Panel (left side, 55%) */
.auth-brand {
  flex: 0 0 55%;
  background: linear-gradient(135deg, var(--bg-base) 0%, #1a2545 40%, var(--bg-base) 100%);
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 4rem;
  overflow: hidden;
}
.auth-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(56,189,248,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56,189,248,0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}
.auth-brand::after {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(129,140,248,0.12), transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* Floating shapes */
.auth-geo {
  position: absolute;
  border: 1px solid rgba(56,189,248,0.12);
  opacity: 0;
  animation: authGeoFloat 12s ease-in-out infinite;
}
.auth-geo:nth-child(1) { width: 120px; height: 120px; border-radius: 24px; top: 12%; left: 8%; animation-delay: 0s; }
.auth-geo:nth-child(2) { width: 80px; height: 80px; border-radius: 50%; top: 65%; left: 15%; animation-delay: 2s; border-color: rgba(129,140,248,0.18); }
.auth-geo:nth-child(3) { width: 160px; height: 160px; border-radius: 32px; top: 20%; right: 10%; animation-delay: 4s; }
.auth-geo:nth-child(4) { width: 60px; height: 60px; border-radius: 12px; bottom: 20%; right: 20%; animation-delay: 6s; border-color: rgba(129,140,248,0.15); }

@keyframes authGeoFloat {
  0% { opacity: 0; transform: translateY(20px) rotate(0deg); }
  20% { opacity: 0.8; }
  80% { opacity: 0.8; }
  100% { opacity: 0; transform: translateY(-20px) rotate(90deg); }
}

.auth-brand-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 460px;
}
.auth-brand-logo {
  width: 72px;
  height: 72px;
  background: var(--gradient-primary);
  border-radius: var(--radius-xl);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: #fff;
  margin-bottom: 2rem;
  box-shadow: 0 8px 32px rgba(56,189,248,0.3);
}
.auth-brand-name {
  font-size: 2.8rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
}
.auth-brand-tagline {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-weight: 300;
  margin-bottom: 3rem;
}
.auth-brand-features {
  list-style: none;
  padding: 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.auth-brand-features li {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-secondary);
  font-size: 0.92rem;
}
.auth-feature-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: rgba(56,189,248,0.08);
  border: 1px solid rgba(56,189,248,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent-cyan);
  font-size: 0.9rem;
}


/* Form Panel (right side, 45%) */
.auth-form-panel {
  flex: 0 0 45%;
  background: var(--bg-base);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2.5rem;
  position: relative;
  overflow-y: auto;
}
.auth-form-panel::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10%;
  bottom: 10%;
  width: 1px;
  background: linear-gradient(to bottom, transparent, rgba(56,189,248,0.3), rgba(129,140,248,0.3), transparent);
}

.auth-form-card {
  width: 100%;
  max-width: 400px;
}
.auth-form-header {
  margin-bottom: 2rem;
}
.auth-form-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}
.auth-form-header p {
  color: var(--text-secondary);
  font-size: 0.92rem;
}

/* Form Messages */
.auth-message {
  padding: 0.8rem 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.2rem;
  display: none;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
}
.auth-message.show { display: flex; }
.auth-message.error {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.25);
  color: var(--color-danger);
}
.auth-message.success {
  background: rgba(34,197,94,0.1);
  border: 1px solid rgba(34,197,94,0.25);
  color: var(--color-success);
}


/* Auth Form Inputs */
.auth-form .form-group { margin-bottom: 1.4rem; }
.auth-form .form-group label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}
.auth-form .form-group label i { color: var(--accent-cyan); width: 14px; font-size: 0.8rem; }
.auth-form .input-wrapper { position: relative; }
.auth-form .form-input {
  width: 100%;
  padding: 0.85rem 1rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.92rem;
  font-family: var(--font-body);
  transition: all var(--transition-fast);
  outline: none;
}
.auth-form .form-input::placeholder { color: var(--text-muted); }
.auth-form .form-input:focus {
  border-color: var(--accent-cyan);
  background: rgba(255,255,255,0.06);
  box-shadow: 0 0 0 3px rgba(56,189,248,0.08);
}
.auth-form .form-input.valid { border-color: var(--color-success); }
.auth-form .form-input.invalid { border-color: var(--color-danger); }

.auth-password-toggle {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.3rem;
  transition: color var(--transition-fast);
}
.auth-password-toggle:hover { color: var(--accent-cyan); }

/* Form Row (side by side) */
.auth-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}


/* Login Options */
.auth-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}
.auth-remember {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
}
.auth-remember input[type="checkbox"] {
  appearance: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid rgba(255,255,255,0.25);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
}
.auth-remember input[type="checkbox"]:checked {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
}
.auth-remember input[type="checkbox"]:checked::after {
  content: '\2713';
  position: absolute;
  color: var(--bg-base);
  font-size: 10px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

/* Submit Button */
.auth-submit {
  width: 100%;
  padding: 0.95rem;
  background: var(--gradient-primary);
  border: none;
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}


.auth-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;
}
.auth-submit:hover::before { left: 100%; }
.auth-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(56,189,248,0.3);
}
.auth-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* Password Strength */
.password-strength {
  margin-top: 0.5rem;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
}
.strength-bar {
  height: 100%;
  width: 0;
  border-radius: 2px;
  transition: all 0.4s ease;
}
.strength-weak { background: var(--color-danger); }
.strength-medium { background: var(--color-warning); }
.strength-strong { background: var(--color-success); }
.strength-text {
  font-size: 0.75rem;
  margin-top: 0.3rem;
  color: var(--text-muted);
}

/* Validation Hint */
.validation-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.validation-hint.valid { color: var(--color-success); }
.validation-hint.invalid { color: var(--color-danger); }


/* Terms */
.auth-terms {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin-bottom: 1.4rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.5;
}
.auth-terms a { color: var(--accent-cyan); text-decoration: none; }
.auth-terms a:hover { color: var(--accent-indigo); }

/* Divider */
.auth-divider {
  text-align: center;
  position: relative;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}
.auth-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border-default), transparent);
}
.auth-divider span {
  background: var(--bg-base);
  padding: 0 1rem;
  position: relative;
}

/* Auth Link */
.auth-link {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.88rem;
}
.auth-link a {
  color: var(--accent-cyan);
  text-decoration: none;
  font-weight: 600;
}
.auth-link a:hover { color: var(--accent-indigo); }

/* Tab Switch */
.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}
.auth-tabs button {
  flex: 1;
  padding: 10px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.auth-tabs button:hover {
  color: var(--text-secondary);
}
.auth-tabs button.active {
  color: var(--accent-cyan);
  border-bottom: 2px solid var(--accent-cyan);
}

/* SMS Code Row */
.sms-code-row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.sms-code-row input {
  flex: 1;
  min-width: 0;
}
.sms-code-row .sms-send-btn {
  white-space: nowrap;
  min-width: auto;
  width: auto;
  padding: 0.85rem 0.75rem;
  font-size: 0.78rem;
  flex-shrink: 0;
}
.sms-send-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}


/* ===== Admin Login (centered card) ===== */
.auth-center {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-base) 0%, #1a2d42 50%, var(--bg-surface) 100%);
  position: relative;
  overflow: hidden;
}
.auth-center::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(56,189,248,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56,189,248,0.03) 1px, transparent 1px);
  background-size: 20px 20px;
}
.auth-center-card {
  position: relative;
  z-index: 1;
  width: 420px;
  padding: 3rem;
  background: rgba(255,255,255,0.04);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-default);
  box-shadow: 0 25px 50px rgba(0,0,0,0.3);
}
.auth-center-header {
  text-align: center;
  margin-bottom: 2rem;
}
.auth-center-logo {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.2rem;
  background: var(--gradient-primary);
  border-radius: var(--radius-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: #fff;
  box-shadow: 0 10px 30px rgba(56,189,248,0.3);
}


.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.9rem;
  background: rgba(129,140,248,0.15);
  border: 1px solid rgba(129,140,248,0.3);
  border-radius: 20px;
  color: var(--accent-indigo);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.auth-center-header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.auth-center-header p {
  color: var(--text-secondary);
  font-size: 0.92rem;
}

/* Admin features grid */
.admin-features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
}
.admin-feature-chip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.8rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.78rem;
}
.admin-feature-chip i { color: var(--accent-cyan); font-size: 0.72rem; width: 14px; text-align: center; }

/* Language Switcher */
.auth-lang-switch {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  backdrop-filter: blur(10px);
}
.auth-lang-switch:hover {
  background: rgba(255,255,255,0.1);
  color: var(--accent-cyan);
  border-color: var(--border-accent);
}


/* Responsive */
@media (max-width: 768px) {
  .auth-brand { display: none; }
  .auth-form-panel { flex: 1; padding: 2rem 1.5rem; }
  .auth-form-card { max-width: 100%; }
  .auth-center-card { width: 90%; margin: 1rem; padding: 2rem; }
  .auth-form-row { grid-template-columns: 1fr; }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .auth-brand { flex: 0 0 50%; padding: 2.5rem; }
  .auth-form-panel { flex: 0 0 50%; }
  .auth-brand-name { font-size: 2.2rem; }
}
