/* Modern Light Theme Styling for Login & Register Pages */

:root {
  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-primary-light: #eff6ff;
  --color-bg-base: #f8fafc;
  --color-bg-card: #ffffff;
  --color-text-main: #0f172a;
  --color-text-muted: #64748b;
  --color-border: #e2e8f0;
  --color-border-focus: #3b82f6;
  --radius-card: 16px;
  --radius-input: 10px;
  --shadow-subtle: 0 4px 20px -2px rgba(15, 23, 42, 0.05);
  --shadow-card: 0 20px 30px -10px rgba(15, 23, 42, 0.08), 0 10px 15px -5px rgba(15, 23, 42, 0.03);
  --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background-color: var(--color-bg-base);
  color: var(--color-text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Background Atmosphere Decorators */
.bg-glow-top {
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 1000px;
  height: 400px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.12) 0%, rgba(248, 250, 252, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

.bg-grid-pattern {
  background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.4;
}

/* Header Navbar */
.top-nav {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2rem;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--color-text-main);
  font-weight: 700;
  font-size: 1.25rem;
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #ffffff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.nav-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background-color: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 9999px;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition-fast);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.nav-back-btn:hover {
  color: var(--color-primary);
  border-color: #93c5fd;
  background-color: var(--color-primary-light);
  transform: translateY(-1px);
}

/* Page Container & Layout */
.auth-wrapper {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem 3rem 1rem;
}

.auth-container {
  width: 100%;
  max-width: 1100px;
  background: var(--color-bg-card);
  border-radius: var(--radius-card);
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 900px) {
  .auth-container {
    grid-template-columns: 1.1fr 1fr;
  }
}

/* Left Brand Hero Side */
.auth-hero-side {
  background: linear-gradient(145deg, #f0fdf4 0%, #eff6ff 50%, #f8fafc 100%);
  padding: 3.5rem 3rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  border-right: 1px solid var(--color-border);
}

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

.auth-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #dbeafe;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #1d4ed8;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.08);
}

.auth-hero-title {
  font-size: 2.125rem;
  font-weight: 800;
  line-height: 1.25;
  color: #0f172a;
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
}

.auth-hero-desc {
  font-size: 0.95rem;
  color: #475569;
  line-height: 1.6;
  margin-bottom: 2.5rem;
}

/* Feature Bullets */
.feature-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.feature-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.feature-text-title {
  font-weight: 600;
  font-size: 0.9375rem;
  color: #1e293b;
}

.feature-text-sub {
  font-size: 0.8125rem;
  color: #64748b;
  margin-top: 0.15rem;
}

/* Quote Box on Bottom of Hero */
.auth-hero-quote {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 12px;
  padding: 1.25rem;
  margin-top: 2.5rem;
}

.quote-text {
  font-size: 0.85rem;
  color: #334155;
  font-style: italic;
  line-height: 1.5;
}

.quote-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
}

.quote-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
}

/* Right Form Side */
.auth-form-side {
  padding: 3rem 2.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (max-width: 640px) {
  .auth-form-side {
    padding: 2rem 1.5rem;
  }
}

.form-header {
  margin-bottom: 2rem;
}

.form-title {
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--color-text-main);
  margin-bottom: 0.5rem;
}

.form-subtitle {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* Nav Tabs */
.auth-tabs {
  display: flex;
  border-bottom: 2px solid #f1f5f9;
  margin-bottom: 1.75rem;
  gap: 1.5rem;
}

.auth-tab-btn {
  background: none;
  border: none;
  padding: 0.6rem 0.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text-muted);
  cursor: pointer;
  position: relative;
  transition: var(--transition-fast);
}

.auth-tab-btn:hover {
  color: var(--color-text-main);
}

.auth-tab-btn.active {
  color: var(--color-primary);
}

.auth-tab-btn.active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--color-primary);
  border-radius: 2px;
}

/* Inputs & Groups */
.form-group {
  margin-bottom: 1.25rem;
  position: relative;
}

.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.4rem;
}

.input-container {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 1rem;
  color: #94a3b8;
  font-size: 1rem;
  pointer-events: none;
  transition: var(--transition-fast);
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  background-color: #f8fafc;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-input);
  font-size: 0.9375rem;
  color: var(--color-text-main);
  outline: none;
  transition: var(--transition-fast);
}

.form-input::placeholder {
  color: #94a3b8;
}

.form-input:focus {
  background-color: #ffffff;
  border-color: var(--color-border-focus);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

.form-input:focus + .input-icon,
.input-container:focus-within .input-icon {
  color: var(--color-primary);
}

.toggle-password {
  position: absolute;
  right: 1rem;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.25rem;
  font-size: 0.95rem;
  transition: var(--transition-fast);
  border: 0;
  background: transparent;
}

.toggle-password:hover {
  color: var(--color-text-main);
}

/* Verification Code Group */
.verify-group {
  display: flex;
  gap: 0.75rem;
}

.verify-input-wrap {
  flex: 1;
}

.btn-send-code {
  padding: 0 1.25rem;
  background-color: #f1f5f9;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-input);
  color: var(--color-primary);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-fast);
}

.btn-send-code:hover:not(:disabled) {
  background-color: var(--color-primary-light);
  border-color: #bfdbfe;
}

.btn-send-code:disabled {
  background-color: #f1f5f9;
  color: #94a3b8;
  cursor: not-allowed;
}

/* Password Strength Bar */
.password-strength-wrap {
  margin-top: 0.5rem;
}

.strength-meter {
  height: 4px;
  width: 100%;
  background-color: #e2e8f0;
  border-radius: 2px;
  overflow: hidden;
  display: flex;
  gap: 2px;
}

.strength-segment {
  flex: 1;
  height: 100%;
  background-color: transparent;
  transition: var(--transition-fast);
}

.strength-segment.is-on {
  background-color: #f59e0b;
}

.strength-segment.is-medium {
  background-color: #3b82f6;
}

.strength-segment.is-strong {
  background-color: #10b981;
}

.strength-text {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.25rem;
  display: flex;
  justify-content: space-between;
}

/* Checkbox & Options Row */
.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  font-size: 0.8125rem;
}

.custom-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
  color: #475569;
}

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

.forgot-link, .agreement-link {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition-fast);
}

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

/* Agreement Checkbox Highlight animation when submitted unchecked */
.shake-agreement {
  animation: shakeAlert 0.4s ease-in-out;
  padding: 0.5rem;
  border-radius: 8px;
  background-color: #fef2f2;
  border: 1px solid #fecaca;
}

@keyframes shakeAlert {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* Action Buttons */
.btn-submit {
  width: 100%;
  padding: 0.85rem 1.5rem;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-input);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-submit:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.32);
}

.btn-submit:active {
  transform: translateY(0);
}

.btn-submit .spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Divider & Social Login */
.social-divider {
  display: flex;
  align-items: center;
  margin: 1.75rem 0 1.25rem 0;
  color: #94a3b8;
  font-size: 0.75rem;
}

.social-divider::before, .social-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background-color: #e2e8f0;
}

.social-divider span {
  padding: 0 0.75rem;
}

.social-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.social-btn {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--color-border);
  background-color: #ffffff;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.social-btn:hover {
  background-color: #f8fafc;
  border-color: #cbd5e1;
  color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

/* Switch Form Footer */
.form-footer {
  text-align: center;
  margin-top: 1.75rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.form-footer a {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
  margin-left: 0.25rem;
}

.form-footer a:hover {
  text-decoration: underline;
}

/* QR Code Display Container */
.qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  margin-bottom: 1.25rem;
}

.qr-box {
  width: 160px;
  height: 160px;
  background: #ffffff;
  padding: 10px;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.qr-tip {
  font-size: 0.8125rem;
  color: #64748b;
  margin-top: 0.75rem;
  text-align: center;
}

/* Custom Modal Dialog (User Agreement & Privacy Policy & Reset Password) */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-card {
  width: 100%;
  max-width: 650px;
  max-height: 85vh;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: #0f172a;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.25rem;
  transition: var(--transition-fast);
}

.modal-close:hover {
  color: #0f172a;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  font-size: 0.875rem;
  line-height: 1.7;
  color: #334155;
  flex: 1;
}

.modal-body h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  margin: 1.25rem 0 0.5rem 0;
}

.modal-body h4:first-child {
  margin-top: 0;
}

.modal-body p {
  margin-bottom: 0.75rem;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid #e2e8f0;
  background-color: #f8fafc;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Toast Alert Message (jQuery Dynamic Injection) */
.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast-msg {
  pointer-events: auto;
  padding: 0.85rem 1.25rem;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #0f172a;
  min-width: 280px;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

.toast-success { border-left: 4px solid #10b981; }
.toast-success i { color: #10b981; }

.toast-error { border-left: 4px solid #ef4444; }
.toast-error i { color: #ef4444; }

.toast-info { border-left: 4px solid #3b82f6; }
.toast-info i { color: #3b82f6; }

.toast-warning { border-left: 4px solid #f59e0b; }

.toast-icon {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.82rem;
  font-weight: 800;
  background: #eff6ff;
  color: #2563eb;
}

.toast-success .toast-icon {
  background: #ecfdf5;
  color: #059669;
}

.toast-error .toast-icon {
  background: #fef2f2;
  color: #dc2626;
}

.toast-warning .toast-icon {
  background: #fffbeb;
  color: #d97706;
}

[hidden] {
  display: none !important;
}

.form-group.has-error .form-input {
  border-color: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
}

.policy-message {
  margin: -0.75rem 0 1.25rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 0.82rem;
  line-height: 1.55;
}

.policy-message.is-error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #dc2626;
}

.captcha-question {
  min-width: 116px;
}

/* Global Footer */
.site-footer {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 1.5rem;
  font-size: 0.8125rem;
  color: #94a3b8;
  border-top: 1px solid rgba(226, 232, 240, 0.6);
  background-color: rgba(255,255,255,0.5);
}
