*, *::before, *::after { box-sizing: border-box; }
:root {
  --bg: #0D0F14;
  --surface: #161920;
  --card: #1C2028;
  --border: #252A35;
  --border-l: #2E3444;
  --accent: #4F7CFF;
  --accent-dim: #1E2D5A;
  --green: #2DD4A0;
  --green-dim: #0D3327;
  --red: #FF5C5C;
  --red-dim: #3A1010;
  --text: #EEF0F6;
  --text-m: #7A8099;
  --text-d: #4A5068;
  --font: 'DM Sans', 'Helvetica Neue', sans-serif;
}
html.light {
  --bg: #F0F2F7;
  --surface: #FAFAFA;
  --card: #FFFFFF;
  --border: #E2E6EF;
  --border-l: #CDD2DF;
  --accent: #3B6AEF;
  --accent-dim: #EBF0FD;
  --green: #0E9E72;
  --green-dim: #E0F5EE;
  --red: #E03E3E;
  --red-dim: #FDECEC;
  --text: #111827;
  --text-m: #5A6278;
  --text-d: #9CA3AF;
}
body { background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; min-height: 100vh; }

.page { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }

.panel-l {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 32px 40px;
  display: flex; flex-direction: column;
  position: relative; overflow: hidden;
}
.panel-l-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 44px 44px; opacity: 0.25;
  mask-image: radial-gradient(ellipse 100% 100% at 30% 100%, black, transparent 70%);
}
.auth-logo { display: flex; align-items: center; gap: 9px; text-decoration: none; position: relative; z-index: 1; }
.auth-logo-mark { width: 28px; height: 28px; border-radius: 7px; background: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.auth-logo-mark svg { width: 16px; height: 16px; color: #fff; stroke: #fff; fill: none; }
.auth-logo-text { font-size: 15px; font-weight: 600; color: var(--text); letter-spacing: -0.2px; }

.panel-body { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; padding-top: 48px; position: relative; z-index: 1; }
.panel-body h2 { font-size: clamp(22px, 2.2vw, 30px); font-weight: 600; letter-spacing: -0.5px; line-height: 1.2; color: var(--text); margin-bottom: 12px; }
.panel-body h2 em { font-style: normal; color: var(--accent); }
.panel-body p { font-size: 14px; color: var(--text-m); line-height: 1.7; max-width: 320px; margin-bottom: 32px; }
.panel-feats { display: flex; flex-direction: column; gap: 12px; margin-bottom: 36px; }
.panel-feat { display: flex; align-items: center; gap: 10px; }
.panel-feat-icon { width: 30px; height: 30px; border-radius: 7px; background: var(--accent-dim); border: 1px solid rgba(79,124,255,0.2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.panel-feat-text { font-size: 13px; color: var(--text-m); }
.testimonial { padding: 16px 18px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; }
.testimonial-text { font-size: 13px; color: var(--text-m); line-height: 1.6; font-style: italic; margin-bottom: 10px; }
.testimonial-author { display: flex; align-items: center; gap: 8px; }
.t-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 600; color: #fff; flex-shrink: 0; }
.t-name { font-size: 12px; font-weight: 500; color: var(--text); }
.t-role { font-size: 11px; color: var(--text-d); }

.panel-r { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 32px; padding: 32px 40px; }
.auth-logo-mobile { display: none; }

.auth-box { width: 100%; max-width: 380px; }

.tabs { display: flex; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 3px; margin-bottom: 32px; }
.tab { flex: 1; padding: 8px; border-radius: 7px; border: none; background: transparent; font-size: 13px; font-weight: 500; color: var(--text-m); cursor: pointer; font-family: var(--font); transition: all 0.15s; text-align: center; text-decoration: none; display: block; }
.tab.on { background: var(--card); color: var(--text); border: 1px solid var(--border); }

.auth-title { font-size: 20px; font-weight: 600; letter-spacing: -0.3px; margin-bottom: 4px; }
.auth-sub { font-size: 13px; color: var(--text-m); margin-bottom: 24px; }

.fg { margin-bottom: 14px; }
label { display: block; font-size: 11px; font-weight: 500; color: var(--text-m); margin-bottom: 5px; letter-spacing: 0.2px; }
input[type=text], input[type=email], input[type=password] {
  width: 100%; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 13px;
  font-family: var(--font); outline: none; transition: border-color 0.15s;
}
input:focus { border-color: var(--accent); }
input::placeholder { color: var(--text-d); }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 40px; }
.pw-eye { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--text-d); display: flex; padding: 2px; }
.pw-eye:hover { color: var(--text-m); }
.forgot-link { text-align: right; margin-top: -6px; margin-bottom: 14px; }
.forgot-link a { font-size: 11px; color: var(--text-d); text-decoration: none; }
.forgot-link a:hover { color: var(--accent); }

.remember-row { display: flex; align-items: center; justify-content: space-between; margin-top: -6px; margin-bottom: 14px; }
.remember-row label { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12px; font-weight: 400; color: var(--text-m); cursor: pointer; }
.remember-row input[type=checkbox] { accent-color: var(--accent); width: 14px; height: 14px; cursor: pointer; }
.remember-row a { font-size: 11px; color: var(--text-d); text-decoration: none; }
.remember-row a:hover { color: var(--accent); }

.btn-submit { display: block; width: 100%; padding: 11px; border-radius: 8px; background: var(--accent); border: none; color: #fff; font-size: 14px; font-weight: 500; font-family: var(--font); cursor: pointer; transition: all 0.15s; margin-bottom: 14px; text-align: center; text-decoration: none; box-sizing: border-box; }
.btn-submit:hover { filter: brightness(1.1); transform: translateY(-1px); }
.divider { display: flex; align-items: center; gap: 10px; margin: 16px 0; }
.div-line { flex: 1; height: 1px; background: var(--border); }
.div-txt { font-size: 11px; color: var(--text-d); }

.auth-footer { text-align: center; font-size: 12px; color: var(--text-d); margin-top: 20px; }
.auth-footer a { color: var(--accent); text-decoration: none; }
.auth-terms { font-size: 11px; color: var(--text-d); text-align: center; line-height: 1.6; margin-top: 16px; }
.auth-terms a { color: var(--text-d); text-decoration: underline; }

/* allauth form helpers: hide Bootstrap wrappers we don't need */
.auth-box .mb-3 { margin-bottom: 14px; }
.auth-box .form-text { font-size: 11px; color: var(--text-d); margin-top: 4px; }
.auth-box .form-text ul { margin: 0; padding-left: 14px; }
.auth-box .form-text ul li + li { margin-top: 2px; }
.auth-box .errorlist { list-style: none; padding: 0; margin: 4px 0 0; }
.auth-box .errorlist li { font-size: 11px; color: var(--red); }
.auth-box .invalid-feedback { display: block; margin-top: 6px; padding: 8px 10px; background: var(--red-dim); border: 1px solid var(--red); border-radius: 6px; }
.auth-box .invalid-feedback p { margin: 0; font-size: 12px; color: var(--red); }
.auth-box .invalid-feedback p strong { font-weight: 500; }

@media (max-width: 720px) {
  .page { grid-template-columns: 1fr; }
  .panel-l { display: none; }
  .panel-r { padding: 48px 24px; align-items: flex-start; justify-content: flex-start; }
  .auth-logo-mobile { display: flex; align-self: center; }
  .auth-box { max-width: 100%; }
}
