*, *::before, *::after { box-sizing: border-box; }

:root {
  --ink: #1e293b;
  --muted: #64748b;
  --accent: #6d28d9;
  --accent-dark: #5b21b6;
  --accent-soft: #ede9fe;
  --border: #e2e8f0;
  --bg: #f8fafc;
  --error: #dc2626;
  --success: #16a34a;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

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

/* ---------- Brand panel ---------- */
.brand-panel {
  background: linear-gradient(160deg, #1e1b4b 0%, #312e81 45%, #6d28d9 100%);
  color: #fff;
  padding: 3rem 3.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.14);
  font-size: 1.1rem;
  color: #fff;
}

.logo-text {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-quote {
  margin-top: 2rem;
}

.brand-quote h2 {
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.brand-quote p {
  margin-top: 1.25rem;
  font-size: 1.05rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  max-width: 34ch;
}

.brand-stats {
  display: flex;
  gap: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.stat {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
}

.stat-label {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.75);
  margin-top: 0.25rem;
}

/* ---------- Form panel ---------- */
.form-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem 4rem;
  max-width: 520px;
  margin: 0 auto;
}

.form-header h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}

.form-header p {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0 0 2rem;
}

/* ---------- Form fields ---------- */
.field {
  margin-bottom: 1.25rem;
}

.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.field input {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 0.75rem;
  font-size: 0.95rem;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(109, 40, 217, 0.12);
}

.field input.invalid {
  border-color: var(--error);
}

.field-error {
  display: block;
  font-size: 0.78rem;
  color: var(--error);
  margin-top: 0.35rem;
  min-height: 1em;
}

/* ---------- Password toggle ---------- */
.password-wrap {
  position: relative;
}

.password-wrap input {
  padding-right: 3rem;
}

.toggle-password {
  position: absolute;
  top: 50%;
  right: 0.9rem;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--muted);
  padding: 0.25rem;
}

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

.checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--ink);
}

.checkbox input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
}

.forgot-link {
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.forgot-link:hover {
  color: var(--accent-dark);
}

/* ---------- Buttons ---------- */
.submit-btn {
  width: 100%;
  padding: 0.9rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.submit-btn:hover {
  background: var(--accent-dark);
}

.submit-btn:active {
  transform: scale(0.98);
}

.divider {
  display: flex;
  align-items: center;
  margin: 1.75rem 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.divider span {
  padding: 0 1rem;
}

.social-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.social-btn {
  padding: 0.8rem;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.social-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

/* ---------- Signup prompt ---------- */
.signup-prompt {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}

.signup-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.signup-link:hover {
  color: var(--accent-dark);
}

/* ---------- Success state ---------- */
.success-banner {
  display: none;
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  background: #ecfdf5;
  color: var(--success);
  border: 1px solid #bbf7d0;
  border-radius: 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .login-page {
    grid-template-columns: 1fr;
  }
  .brand-panel {
    display: none;
  }
  .form-panel {
    padding: 2.5rem 1.5rem;
  }
}