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

    body {
      font-family: "Noto Sans", sans-serif;
      background-color: #ede8df;
      background-image: url("{% static 'images/bg.png' %}");
      background-repeat: no-repeat;
      background-size: cover;
      background-attachment: fixed;
      min-height: 100vh;
      color: #573e19;
    }

    .auth-page {
      min-height: calc(100vh - 70px);
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 48px 16px 60px;
    }

    .auth-wrap { width: 100%; max-width: 440px; }

    /* Brand */
    .auth-brand { text-align: center; margin-bottom: 26px; }
    .auth-brand-name { font-size: 21px; font-weight: 800; color: #2d5a1b; }
    .auth-brand-sub  { font-size: 12px; color: #888; margin-top: 2px; }

    /* Messages */
    .auth-messages { margin-bottom: 14px; }
    .auth-msg {
      padding: 11px 15px;
      border-radius: 9px;
      font-size: 13px;
      font-weight: 600;
      margin-bottom: 8px;
    }
    .auth-msg.error   { background:#fee2e2; color:#b91c1c; border:1px solid #fca5a5; }
    .auth-msg.success { background:#dcf5e0; color:#166534; border:1px solid #86efac; }

    /* Card */
    .auth-card {
      background: #fdf9f2;
      border: 1px solid #d8cbb6;
      border-radius: 18px;
      padding: 32px 32px 36px;
      box-shadow: 0 4px 24px rgba(0,0,0,0.08);
      width: 100%;
    }

    /* Top row */
    .auth-top-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 18px;
    }
    .auth-mode-label {
      font-size: 11px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 1px;
      color: #2d5a1b;
      display: flex;
      align-items: center;
      gap: 7px;
    }
    .auth-mode-label::before {
      content: '';
      width: 20px;
      height: 2px;
      background: #2d5a1b;
      border-radius: 2px;
    }
    .auth-switch-btn {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      padding: 6px 14px;
      background: #ede8df;
      border: 1.5px solid #d8cbb6;
      border-radius: 20px;
      font-family: "Noto Sans", sans-serif;
      font-size: 12px;
      font-weight: 800;
      color: #573e19;
      cursor: pointer;
      transition: background .2s, border-color .2s, color .2s;
    }
    .auth-switch-btn:hover { background:#2d5a1b; border-color:#2d5a1b; color:#fff; }

    /* Panels */
    .auth-panel { display: none; }
    .auth-panel.active { display: block; }

    .auth-panel-title { font-size: 23px; font-weight: 800; color: #573e19; margin-bottom: 5px; }
    .auth-panel-sub   { font-size: 13px; color: #888; line-height: 1.6; margin-bottom: 24px; }

    /* Steps */
    .auth-step { display: none; flex-direction: column; }
    .auth-step.active { display: flex; }

    /* OTP sent banner */
    .otp-sent-info {
      background: #eef6e6;
      border: 1px solid #c4ddb0;
      border-radius: 10px;
      padding: 11px 14px;
      font-size: 13px;
      color: #2d5a1b;
      font-weight: 600;
      margin-bottom: 18px;
    }

    /* Field */
    .auth-field { margin-bottom: 14px; width: 100%; }
    .auth-field label {
      display: block;
      font-size: 11.5px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.5px;
      color: #888;
      margin-bottom: 6px;
    }
    .auth-input {
      width: 100%;
      padding: 12px 15px;
      border: 1.5px solid #d8cbb6;
      border-radius: 9px;
      font-family: "Noto Sans", sans-serif;
      font-size: 14px;
      color: #573e19;
      background: #fff;
      outline: none;
      transition: border-color .2s, box-shadow .2s;
    }
    .auth-input:focus { border-color: #2d5a1b; box-shadow: 0 0 0 3px rgba(45,90,27,.1); }
    .auth-input::placeholder { color: #bbb; }
    .auth-input.err   { border-color: #e53e3e; box-shadow: 0 0 0 3px rgba(229,62,62,.1); }

    .field-error { font-size: 11.5px; color: #e53e3e; font-weight: 600; margin-top: 4px; display: none; }
    .field-error.show { display: block; }

    /* ── OTP boxes — KEY FIX: constrained inside card ── */
    .otp-boxes {
      display: grid;
      grid-template-columns: repeat(6, 1fr);
      gap: 7px;
      width: 100%;
      margin-bottom: 6px;
    }
    .otp-box {
      width: 100%;
      height: 52px;
      text-align: center;
      font-size: 20px;
      font-weight: 800;
      color: #573e19;
      border: 1.5px solid #d8cbb6;
      border-radius: 9px;
      background: #fff;
      outline: none;
      transition: border-color .2s, box-shadow .2s;
      padding: 0;
    }
    .otp-box:focus { border-color: #2d5a1b; box-shadow: 0 0 0 3px rgba(45,90,27,.1); }
    .otp-box.filled { border-color: #2d5a1b; background: #f0f8e8; }

    /* Timer row */
    .otp-timer-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 20px;
      font-size: 12.5px;
    }
    .otp-timer { color: #888; font-weight: 600; }
    .otp-timer span { color: #2d5a1b; font-weight: 800; }

    /* Resend — plain button, NOT inside a form */
    .btn-resend {
      background: none;
      border: none;
      font-family: "Noto Sans", sans-serif;
      font-size: 12.5px;
      font-weight: 700;
      color: #bbb;
      cursor: not-allowed;
      padding: 0;
    }
    .btn-resend.can-resend { color: #2d5a1b; cursor: pointer; text-decoration: underline; }

    /* Submit */
    .btn-auth-submit {
      width: 100%;
      padding: 13px;
      background: #2d5a1b;
      color: #fff;
      border: none;
      border-radius: 9px;
      font-family: "Noto Sans", sans-serif;
      font-size: 15px;
      font-weight: 800;
      cursor: pointer;
      transition: background .2s, transform .15s;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 7px;
      margin-top: 4px;
    }
    .btn-auth-submit:hover { background: #3d7a1a; transform: translateY(-1px); }

    /* Back */
    .auth-back {
      background: none;
      border: none;
      font-family: "Noto Sans", sans-serif;
      font-size: 12.5px;
      font-weight: 700;
      color: #888;
      cursor: pointer;
      padding: 0;
      margin-bottom: 16px;
      display: inline-flex;
      align-items: center;
      gap: 4px;
      transition: color .2s;
    }
    .auth-back:hover { color: #573e19; }

    /* Home link */
    .auth-home-link { text-align: center; margin-top: 22px; }
    .auth-home-link a {
      font-size: 13px;
      font-weight: 700;
      color: #888;
      text-decoration: none;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      transition: color .2s;
    }
    .auth-home-link a:hover { color: #2d5a1b; }

    @media (max-width: 480px) {
      .auth-card { padding: 24px 16px 28px; }
      .otp-box   { height: 44px; font-size: 16px; }
      .otp-boxes { gap: 5px; }
    }