*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #4f46e5;
  --primary-dark: #3730a3;
  --primary-light: #eef2ff;
  --accent: #06b6d4;
  --text-dark: #1e293b;
  --text-muted: #64748b;
  --danger: #ef4444;
  --border: #e2e8f0;
}

body {
  font-family: "Inter", system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  background: linear-gradient(135deg, #f0f4ff 0%, #e0f2fe 50%, #f8fafc 100%);
}

/* ===== SPLIT LAYOUT ===== */
.auth-wrapper {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* Left panel - branding */
.auth-panel-left {
  flex: 1;
  background: linear-gradient(
    160deg,
    var(--primary) 0%,
    #312e81 60%,
    #1e1b4b 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 60px 64px;
  position: relative;
  overflow: hidden;
}

.auth-panel-left::before {
  content: "";
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  top: -150px;
  right: -150px;
}

.auth-panel-left::after {
  content: "";
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: rgba(6, 182, 212, 0.12);
  bottom: -80px;
  left: -80px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 56px;
  position: relative;
  z-index: 1;
}

.brand-logo-icon {
  width: 48px;
  height: 48px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #fff;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
  padding: 4px;
}

.brand-logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-logo-text {
  font-weight: 700;
  font-size: 1.15rem;
  color: #fff;
}

.brand-logo-text small {
  display: block;
  font-weight: 400;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
}

.panel-heading {
  color: #fff;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.panel-heading span {
  color: #a5b4fc;
}

.panel-desc {
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.95rem;
  line-height: 1.75;
  max-width: 340px;
  position: relative;
  z-index: 1;
  margin-bottom: 48px;
}

.panel-features {
  list-style: none;
  position: relative;
  z-index: 1;
}

.panel-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.875rem;
  padding: 6px 0;
}

.panel-features li i {
  width: 20px;
  color: #a5b4fc;
  font-size: 0.9rem;
}

.panel-back {
  position: absolute;
  top: 24px;
  left: 24px;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
  z-index: 2;
}

.panel-back:hover {
  color: #fff;
}

/* Right panel - form */
.auth-panel-right {
  width: 480px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px 48px;
  background: #fff;
}

.form-header {
  margin-bottom: 36px;
}

.form-header h1 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.form-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Form elements */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.input-wrap {
  position: relative;
}

.input-wrap i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
  pointer-events: none;
}

.form-input {
  width: 100%;
  padding: 12px 14px 12px 40px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--text-dark);
  background: #f8fafc;
  transition: all 0.2s;
  outline: none;
}

.form-input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.form-input.is-invalid {
  border-color: var(--danger);
}

.invalid-feedback {
  color: var(--danger);
  font-size: 0.8rem;
  margin-top: 5px;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.form-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
}

.form-check label {
  font-size: 0.875rem;
  color: var(--text-muted);
  cursor: pointer;
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.link-muted {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.link-muted:hover {
  color: var(--primary);
}

.btn-submit {
  flex: 1;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 13px 24px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-submit:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.btn-submit:active {
  transform: none;
}

.alert-status {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #065f46;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.85rem;
  margin-bottom: 20px;
}

/* Captcha elements */
.captcha-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.captcha-img-wrap {
  flex: 1;
}

.captcha-img {
  width: 100%;
  height: 44px;
  object-fit: cover;
  border-radius: 10px;
  border: 1.5px solid var(--border);
}

.btn-refresh-captcha {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  outline: none;
  transition: color 0.2s;
}

.btn-refresh-captcha:hover {
  color: var(--primary);
}

.captcha-input-wrap {
  flex: 1;
}

.form-input.captcha-input {
  padding-left: 14px;
}

/* Responsive */
@media (max-width: 900px) {
  .auth-panel-left {
    display: none;
  }

  .auth-panel-right {
    width: 100%;
    padding: 40px 28px;
  }
}

@media (max-width: 480px) {
  .auth-panel-right {
    padding: 32px 20px;
  }
}
