/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --green-deep:   #091f12;
  --green-mid:    #1a4028;
  --green-brand:  #2d6a4f;
  --green-accent: #40916c;
  --green-light:  #52b788;
  --green-glow:   rgba(64, 145, 108, 0.15);

  --white:        #ffffff;
  --off-white:    #f9faf8;
  --gray-100:     #f3f4f6;
  --gray-200:     #e5e7eb;
  --gray-400:     #9ca3af;
  --gray-500:     #6b7280;
  --gray-900:     #111827;

  --error-bg:     #fef2f2;
  --error-border: #fecaca;
  --error-text:   #dc2626;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  --radius-sm:    8px;
  --radius-md:    12px;
  --radius-lg:    16px;
}

html, body {
  height: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  background: var(--off-white);
  color: var(--gray-900);
}

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

/* ── Brand Panel ──────────────────────────────────────────── */
.brand-panel {
  position: relative;
  background-color: var(--green-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Circuit-grid texture */
.brand-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(64, 145, 108, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(64, 145, 108, 0.07) 1px, transparent 1px);
  background-size: 36px 36px;
  pointer-events: none;
}

/* Corner accent lines */
.brand-panel::after {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 120px; height: 120px;
  border-top: 1px solid rgba(64, 145, 108, 0.25);
  border-left: 1px solid rgba(64, 145, 108, 0.25);
  pointer-events: none;
}

.brand-panel__glow {
  position: absolute;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(64, 145, 108, 0.2) 0%, transparent 65%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.brand-panel__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: 64px 48px;
  text-align: center;
  animation: fadeUp 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.brand-logo {
  width: 180px;
  height: auto;
  filter:
    brightness(1.05)
    drop-shadow(0 0 40px rgba(82, 183, 136, 0.35))
    drop-shadow(0 12px 24px rgba(0, 0, 0, 0.4));
  transition: filter 0.3s ease;
}

.brand-logo:hover {
  filter:
    brightness(1.1)
    drop-shadow(0 0 56px rgba(82, 183, 136, 0.5))
    drop-shadow(0 12px 24px rgba(0, 0, 0, 0.4));
}

.brand-tagline {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.45;
  letter-spacing: -0.01em;
}

.brand-badge {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid rgba(82, 183, 136, 0.3);
  border-radius: 100px;
  font-size: 11px;
  font-weight: 500;
  color: rgba(82, 183, 136, 0.8);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(82, 183, 136, 0.06);
}

/* ── Form Panel ───────────────────────────────────────────── */
.form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  background: var(--off-white);
}

.form-panel__inner {
  width: 100%;
  max-width: 380px;
  animation: fadeUp 0.75s 0.08s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.form-header {
  margin-bottom: 36px;
}

.form-heading {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 600;
  color: var(--gray-900);
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 10px;
}

.form-subheading {
  font-size: 14.5px;
  color: var(--gray-500);
  font-weight: 300;
  line-height: 1.5;
}

/* ── Login Form ───────────────────────────────────────────── */
.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

/* Django-rendered inputs */
.login-form input[type="text"],
.login-form input[type="password"] {
  width: 100%;
  padding: 13px 15px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--gray-900);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  -webkit-appearance: none;
}

.login-form input[type="text"]::placeholder,
.login-form input[type="password"]::placeholder {
  color: var(--gray-400);
}

.login-form input[type="text"]:focus,
.login-form input[type="password"]:focus {
  border-color: var(--green-accent);
  box-shadow: 0 0 0 3.5px rgba(64, 145, 108, 0.1);
}

.forgot-link {
  align-self: flex-end;
  font-size: 13px;
  font-weight: 500;
  color: var(--green-accent);
  text-decoration: none;
  transition: color 0.15s ease;
  margin-top: 2px;
}

.forgot-link:hover {
  color: var(--green-brand);
}

/* ── Error Banner ─────────────────────────────────────────── */
.form-error-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 13.5px;
  color: var(--error-text);
  line-height: 1.4;
}

/* ── Submit Button ────────────────────────────────────────── */
.signin-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 24px;
  margin-top: 4px;
  background: var(--green-brand);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(45, 106, 79, 0.32);
  transition:
    background-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.1s ease;
}

.signin-btn:hover {
  background: var(--green-mid);
  box-shadow: 0 6px 24px rgba(45, 106, 79, 0.42);
  transform: translateY(-1px);
}

.signin-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(45, 106, 79, 0.28);
}

/* ── Animation ────────────────────────────────────────────── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Back Link ────────────────────────────────────────────── */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-500);
  text-decoration: none;
  margin-bottom: 32px;
  transition: color 0.15s ease;
}

.back-link:hover {
  color: var(--green-accent);
}

/* ── Status Card (done / complete / invalid-link) ─────────── */
.status-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  animation: fadeUp 0.75s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.status-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  margin-bottom: 4px;
}

.status-icon--success {
  background: rgba(64, 145, 108, 0.1);
  color: var(--green-accent);
}

.status-icon--info {
  background: rgba(59, 130, 246, 0.08);
  color: #3b82f6;
}

.status-icon--error {
  background: rgba(220, 38, 38, 0.08);
  color: var(--error-text);
}

.status-body {
  font-size: 15px;
  color: var(--gray-900);
  line-height: 1.6;
  font-weight: 300;
}

.status-hint {
  font-size: 13.5px;
  color: var(--gray-400);
  line-height: 1.55;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 800px) {
  .login-split {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    min-height: 220px;
  }

  .brand-panel__inner {
    padding: 40px 32px;
    gap: 20px;
  }

  .brand-logo {
    width: 120px;
  }

  .brand-tagline {
    font-size: 20px;
  }

  .form-panel {
    padding: 40px 24px;
    align-items: flex-start;
    padding-top: 48px;
  }

  .form-panel__inner {
    max-width: 100%;
  }

  .form-heading {
    font-size: 30px;
  }
}
