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

    :root {
      --crust:   #0c0a08;
      --surface: #141210;
      --card:    #1a1612;
      --border:  #2a221c;
      --muted:   #3d3028;
      --fog:     #9a8878;
      --sand:    #ede0cc;
      --ember:   #e07b35;
      --ember2:  #c96a20;
    }

    html, body {
      height: 100%;
      background: var(--crust);
      font-family: 'DM Sans', sans-serif;
      color: var(--sand);
      overflow-x: hidden;
    }

    /* ─── BACKGROUND ─── */
    .bg-layer {
      position: fixed; inset: 0; z-index: 0;
      background: var(--crust);
      overflow: hidden;
    }

    /* Grain texture */
    .bg-layer::before {
      content: '';
      position: absolute; inset: 0;
      background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.035'/%3E%3C/svg%3E");
      background-size: 200px 200px;
      pointer-events: none;
    }

    /* Glow orbs */
    .orb {
      position: absolute; border-radius: 50%;
      filter: blur(120px); pointer-events: none;
    }
    .orb-1 {
      width: 600px; height: 600px;
      background: radial-gradient(circle, rgba(224,123,53,0.07) 0%, transparent 70%);
      top: -200px; right: -100px;
      animation: drift1 18s ease-in-out infinite;
    }
    .orb-2 {
      width: 400px; height: 400px;
      background: radial-gradient(circle, rgba(224,123,53,0.05) 0%, transparent 70%);
      bottom: -100px; left: -50px;
      animation: drift2 22s ease-in-out infinite;
    }
    @keyframes drift1 {
      0%,100% { transform: translate(0,0); }
      50%      { transform: translate(-40px, 60px); }
    }
    @keyframes drift2 {
      0%,100% { transform: translate(0,0); }
      50%      { transform: translate(30px,-40px); }
    }

    /* Grid lines */
    .grid-lines {
      position: absolute; inset: 0;
      background-image:
        linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
      background-size: 60px 60px;
      pointer-events: none;
    }

    /* ─── LAYOUT ─── */
    .page {
      position: relative; z-index: 1;
      min-height: 100vh;
      display: grid;
      grid-template-columns: 1fr 1fr;
    }

    /* ─── LEFT PANEL ─── */
    .left-panel {
      display: flex; flex-direction: column;
      justify-content: center; align-items: flex-start;
      padding: 60px 64px;
      border-right: 1px solid var(--border);
      position: relative; overflow: hidden;
    }

    .left-panel::after {
      content: '';
      position: absolute; inset: 0;
      background: linear-gradient(135deg, rgba(224,123,53,.04) 0%, transparent 60%);
      pointer-events: none;
    }

    .brand-logo {
      font-family: 'Syne', sans-serif; font-weight: 800;
      font-size: 3.5rem; letter-spacing: -2px;
      line-height: 1; margin-bottom: 28px;
      position: relative;
    }
    .brand-logo .dot { color: var(--ember); }

    .brand-tagline {
      font-size: 1.15rem; font-weight: 400;
      color: var(--fog); line-height: 1.6;
      max-width: 360px; margin-bottom: 56px;
    }
    .brand-tagline strong { color: var(--sand); font-weight: 600; }

    /* Feature list */
    .features { display: flex; flex-direction: column; gap: 20px; }
    .feature-item {
      display: flex; align-items: center; gap: 14px;
    }
    .feature-icon {
      width: 40px; height: 40px; border-radius: 10px;
      background: rgba(224,123,53,.1); border: 1px solid rgba(224,123,53,.2);
      display: flex; align-items: center; justify-content: center;
      flex-shrink: 0; color: var(--ember);
    }
    .feature-icon svg { width: 18px; height: 18px; }
    .feature-text { font-size: .9rem; color: var(--fog); }
    .feature-text strong { color: var(--sand); font-weight: 600; }

    /* Floating card decoration */
    .deco-card {
      position: absolute; bottom: 48px; right: -20px;
      background: var(--card); border: 1px solid var(--border);
      border-radius: 16px; padding: 16px 20px;
      display: flex; align-items: center; gap: 12px;
      box-shadow: 0 20px 60px rgba(0,0,0,.4);
      animation: float 4s ease-in-out infinite;
    }
    @keyframes float {
      0%,100% { transform: translateY(0); }
      50%      { transform: translateY(-8px); }
    }
    .deco-avatars { display: flex; }
    .deco-avatar {
      width: 28px; height: 28px; border-radius: 50%;
      border: 2px solid var(--card);
      background: var(--muted); margin-left: -8px;
      overflow: hidden;
    }
    .deco-avatar:first-child { margin-left: 0; }
    .deco-avatar img { width: 100%; height: 100%; object-fit: cover; }
    .deco-text { font-size: .78rem; }
    .deco-text strong { color: var(--sand); display: block; font-weight: 600; }
    .deco-text span { color: var(--fog); }
    .deco-pulse {
      width: 8px; height: 8px; border-radius: 50%;
      background: #22c55e; flex-shrink: 0;
      box-shadow: 0 0 8px rgba(34,197,94,.5);
      animation: pulse 2s ease infinite;
    }
    @keyframes pulse {
      0%,100% { opacity: 1; transform: scale(1); }
      50%      { opacity: .6; transform: scale(.85); }
    }

    /* ─── RIGHT PANEL ─── */
    .right-panel {
      display: flex; flex-direction: column;
      justify-content: center; align-items: center;
      padding: 60px 64px;
    }

    .form-wrap {
      width: 100%; max-width: 400px;
    }

    /* Top logo mobile (hidden on desktop) */
    .mobile-logo {
      display: none;
      font-family: 'Syne', sans-serif; font-weight: 800;
      font-size: 2rem; letter-spacing: -1px;
      margin-bottom: 32px; text-align: center;
    }
    .mobile-logo .dot { color: var(--ember); }

    .form-title {
      font-family: 'Syne', sans-serif; font-weight: 700;
      font-size: 1.6rem; letter-spacing: -.5px;
      margin-bottom: 6px; color: var(--sand);
    }
    .form-subtitle {
      font-size: .88rem; color: var(--fog);
      margin-bottom: 36px; line-height: 1.5;
    }

    /* Django messages */
    .django-alert {
      padding: 12px 16px; border-radius: 10px;
      font-size: .85rem; margin-bottom: 20px;
      border: 1px solid;
    }
    .django-alert.success {
      background: rgba(34,197,94,.08);
      border-color: rgba(34,197,94,.25); color: #4ade80;
    }
    .django-alert.error {
      background: rgba(239,68,68,.08);
      border-color: rgba(239,68,68,.25); color: #f87171;
    }

    /* ─── FORM ─── */
    .form-group { margin-bottom: 18px; }
    .form-label {
      display: block; font-size: .78rem; font-weight: 700;
      color: var(--fog); margin-bottom: 8px;
      text-transform: uppercase; letter-spacing: .8px;
    }

    .input-wrap {
      position: relative;
    }
    .input-icon {
      position: absolute; left: 14px; top: 50%;
      transform: translateY(-50%); pointer-events: none;
      color: var(--muted); transition: color .2s;
    }
    .input-icon svg { width: 17px; height: 17px; }

    .input-field {
      width: 100%; background: var(--card);
      border: 1.5px solid var(--border);
      border-radius: 12px; padding: 13px 14px 13px 44px;
      font-size: .92rem; color: var(--sand);
      outline: none; transition: border-color .2s, box-shadow .2s;
      font-family: 'DM Sans', sans-serif;
    }
    .input-field::placeholder { color: var(--muted); }
    .input-field:focus {
      border-color: rgba(224,123,53,.5);
      box-shadow: 0 0 0 3px rgba(224,123,53,.08);
    }
    .input-field:focus + .input-icon,
    .input-wrap:focus-within .input-icon { color: var(--ember); }

    /* Password toggle */
    .toggle-eye {
      position: absolute; right: 14px; top: 50%;
      transform: translateY(-50%); cursor: pointer;
      color: var(--muted); background: none; border: none;
      padding: 4px; transition: color .2s;
    }
    .toggle-eye:hover { color: var(--ember); }
    .toggle-eye svg { width: 17px; height: 17px; }

    /* Field error */
    .field-error {
      font-size: .78rem; color: #f87171;
      margin-top: 6px; display: none;
      padding-left: 4px;
    }

    /* ─── OPTIONS ROW ─── */
    .options-row {
      display: flex; align-items: center;
      justify-content: space-between;
      margin-bottom: 28px;
    }
    .checkbox-label {
      display: flex; align-items: center; gap: 9px;
      cursor: pointer; font-size: .85rem; color: var(--fog);
      user-select: none;
    }
    .checkbox-label input { display: none; }
    .custom-checkbox {
      width: 18px; height: 18px;
      border: 1.5px solid var(--muted); border-radius: 5px;
      background: var(--card);
      display: flex; align-items: center; justify-content: center;
      transition: all .2s; flex-shrink: 0;
    }
    .checkbox-label input:checked + .custom-checkbox {
      background: var(--ember); border-color: var(--ember);
    }
    .custom-checkbox svg {
      width: 11px; height: 11px; color: #0c0a08;
      opacity: 0; transform: scale(.6); transition: all .15s;
    }
    .checkbox-label input:checked + .custom-checkbox svg {
      opacity: 1; transform: scale(1);
    }
    .forgot-link {
      font-size: .85rem; color: var(--fog); text-decoration: none;
      transition: color .2s;
    }
    .forgot-link:hover { color: var(--ember); }

    /* ─── ALERT MESSAGES ─── */
    .alert-box {
      padding: 12px 16px; border-radius: 10px;
      font-size: .85rem; margin-bottom: 20px;
      display: none; align-items: center; gap: 10px;
      border: 1px solid;
    }
    .alert-box.error {
      background: rgba(239,68,68,.08);
      border-color: rgba(239,68,68,.25); color: #f87171;
    }
    .alert-box.success {
      background: rgba(34,197,94,.08);
      border-color: rgba(34,197,94,.25); color: #4ade80;
    }
    .alert-box svg { width: 16px; height: 16px; flex-shrink: 0; }

    /* ─── SUBMIT BUTTON ─── */
    .submit-btn {
      width: 100%; padding: 14px;
      background: var(--ember); border: none;
      border-radius: 12px; color: #0c0a08;
      font-family: 'Syne', sans-serif; font-weight: 700;
      font-size: .95rem; cursor: pointer;
      transition: all .2s;
      display: flex; align-items: center; justify-content: center; gap: 10px;
      position: relative; overflow: hidden;
    }
    .submit-btn::before {
      content: '';
      position: absolute; inset: 0;
      background: linear-gradient(135deg, rgba(255,255,255,.12) 0%, transparent 50%);
      pointer-events: none;
    }
    .submit-btn:hover:not(:disabled) {
      background: var(--ember2);
      transform: translateY(-1px);
      box-shadow: 0 8px 24px rgba(224,123,53,.35);
    }
    .submit-btn:active:not(:disabled) { transform: translateY(0); }
    .submit-btn:disabled {
      opacity: .55; cursor: not-allowed; transform: none;
    }

    /* Spinner */
    .btn-spinner {
      width: 18px; height: 18px;
      border: 2px solid rgba(12,10,8,.25);
      border-top-color: #0c0a08;
      border-radius: 50%; animation: spin 0.75s linear infinite;
      display: none; flex-shrink: 0;
    }
    @keyframes spin { to { transform: rotate(360deg); } }

    /* ─── FOOTER LINK ─── */
    .register-link {
      text-align: center; margin-top: 28px;
      font-size: .88rem; color: var(--fog);
    }
    .register-link a {
      color: var(--ember); font-weight: 600;
      text-decoration: none; transition: color .2s;
    }
    .register-link a:hover { color: var(--ember2); text-decoration: underline; }

    /* Divider */
    .divider {
      display: flex; align-items: center; gap: 12px;
      margin: 24px 0;
    }
    .divider::before, .divider::after {
      content: ''; flex: 1;
      height: 1px; background: var(--border);
    }
    .divider span {
      font-size: .75rem; color: var(--muted);
      white-space: nowrap; font-weight: 500;
    }

    /* ─── RESPONSIVE ─── */
    @media (max-width: 768px) {
      .page { grid-template-columns: 1fr; }
      .left-panel { display: none; }
      .right-panel { padding: 40px 24px; justify-content: flex-start; padding-top: 60px; }
      .mobile-logo { display: block; }
      .form-wrap { max-width: 100%; }
    }

    /* ─── ANIMATIONS ─── */
    .fade-up {
      opacity: 0; transform: translateY(18px);
      animation: fadeUp .55s ease forwards;
    }
    @keyframes fadeUp {
      to { opacity: 1; transform: translateY(0); }
    }
    .delay-1 { animation-delay: .05s; }
    .delay-2 { animation-delay: .12s; }
    .delay-3 { animation-delay: .19s; }
    .delay-4 { animation-delay: .26s; }
    .delay-5 { animation-delay: .33s; }
    .delay-6 { animation-delay: .40s; }
