/* Shared authentication page layout */
.auth-page-body {
  min-height: 100vh;
  height: auto;
  overflow-x: hidden;
  overflow-y: auto;
  background-color: var(--color-background);
}

.auth-page {
  width: 100%;
  overflow-y: auto;
  padding: 80px 32px 64px;
  background-color: var(--color-background);
  color: var(--color-foreground);

  a {
    color: inherit;
    text-decoration: none;
  }

  .auth-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    max-width: 1288px;
    margin: 0 auto;
  }

  .auth-brand {
    color: var(--color-foreground);
    font-size: 21px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.35px;
  }

  .auth-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 34px;
    color: var(--color-foreground);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    transition: color 0.2s ease;
  }

  .auth-back:hover,
  .auth-alternate a:hover {
    color: var(--color-primary);
  }

  .auth-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 560px;
    margin: 34px auto 0;
    padding: 48px;
    border-radius: 12px;
    background-color: var(--color-surface);
    color: var(--color-foreground);

    .auth-eyebrow {
      color: var(--color-foreground);
      font-size: 11px;
      font-weight: 700;
      line-height: 1.4;
      text-transform: uppercase;
    }

    .auth-title {
      margin-top: 26px;
      color: var(--color-primary);
      font-size: 34px;
      font-weight: 400;
      line-height: 1.27;
      letter-spacing: -0.6px;
      text-transform: uppercase;
    }

    .auth-description {
      margin-top: 24px;
      color: var(--color-foreground);
      font-size: 16px;
      font-weight: 400;
      line-height: 1.5;
    }
  }

  .auth-form {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
    max-width: none;
    margin-top: 24px;
    padding: 0;

    .auth-field {
      display: flex;
      flex-direction: column;
      gap: 9px;
      width: 100%;
      min-width: 0;

      label {
        color: var(--color-foreground);
        font-size: 13px;
        font-weight: 700;
        line-height: 1.4;
      }

      input,
      textarea,
      select {
        display: block;
        width: 100%;
        min-width: 0;
        min-height: 53px;
        padding: 0 16px;
        border: 1px solid transparent;
        border-radius: 12px;
        outline: none;
        background-color: var(--color-background);
        color: var(--color-foreground);
        font-family: inherit;
        font-size: 14px;
        line-height: 1.4;
        transition:
          border-color 0.18s ease,
          box-shadow 0.18s ease,
          background-color 0.18s ease;
      }

      input::placeholder,
      textarea::placeholder {
        color: #777681;
        opacity: 1;
      }

      input:hover,
      textarea:hover,
      select:hover {
        border-color: rgba(131, 49, 26, 0.35);
      }

      input:focus,
      textarea:focus,
      select:focus {
        border-color: var(--color-primary);
        background-color: #FFFFFF;
        box-shadow: 0 0 0 3px rgba(249, 63, 18, 0.10);
      }

      .errorlist {
        display: flex;
        flex-direction: column;
        gap: 4px;
        margin: 0;
        padding: 0;
        color: #B42318;
        font-size: 12px;
        line-height: 1.45;
        list-style: none;

        li {
          overflow-wrap: anywhere;
        }
      }
    }

    > .errorlist,
    > ul.errorlist {
      display: flex;
      flex-direction: column;
      gap: 5px;
      margin: 0;
      padding: 12px 14px;
      border: 1px solid rgba(180, 35, 24, 0.2);
      border-radius: 8px;
      background-color: #FFF5F4;
      color: #B42318;
      font-size: 13px;
      line-height: 1.45;
      list-style: none;
    }

    .auth-help {
      color: var(--color-foreground-muted);
      font-size: 11px;
      line-height: 1.5;

      ul {
        display: flex;
        flex-direction: column;
        gap: 4px;
        padding-left: 18px;
      }

      li {
        margin: 0;
      }
    }

    .auth-disclaimer {
      margin-top: -1px;
      color: var(--color-foreground);
      font-size: 12px;
      font-weight: 400;
      line-height: 1.55;
    }

    .auth-submit {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      min-height: 54px;
      margin-top: 1px;
      padding: 12px 20px;
      border: 1px solid var(--color-accent-brown);
      border-radius: 8px;
      background-color: var(--color-accent-yellow);
      color: var(--color-accent-brown);
      font-family: inherit;
      font-size: 13px;
      font-weight: 500;
      line-height: 1.3;
      letter-spacing: 0.45px;
      text-align: center;
      text-transform: uppercase;
      cursor: pointer;
      transition:
        background-color 0.2s ease,
        transform 0.2s ease;

      &:hover {
        background-color: #F8CE55;
      }

      &:active {
        transform: translateY(1px);
      }

      &:focus-visible {
        outline: 3px solid rgba(69, 75, 187, 0.35);
        outline-offset: 3px;
      }

      &:disabled {
        cursor: not-allowed;
        opacity: 0.65;
      }
    }
  }

  .auth-alternate {
    margin-top: 20px;
    color: var(--color-foreground);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;

    a {
      color: var(--color-foreground);
      font-weight: 500;
      text-decoration: none;
      text-underline-offset: 3px;
    }

    a:hover {
      text-decoration: underline;
    }
  }
}

@media (max-width: 700px) {
  .auth-page {
    padding: 28px 24px 24px;

    .auth-brand {
      font-size: 22px;
    }

    .auth-back {
      margin-top: 32px;
    }

    .auth-card {
      margin-top: 33px;
      padding: 24px;

      .auth-title {
        margin-top: 26px;
        font-size: 29px;
        line-height: 1.3;
        letter-spacing: -0.45px;
      }

      .auth-description {
        margin-top: 24px;
        font-size: 16px;
        line-height: 1.55;
      }
    }

    .auth-form {
      gap: 24px;
      margin-top: 26px;

      .auth-field {
        gap: 9px;

        input,
        textarea,
        select {
          min-height: 53px;
          font-size: 14px;
        }
      }

      .auth-disclaimer {
        margin-top: 0;
        font-size: 12px;
        line-height: 1.6;
      }

      .auth-submit {
        min-height: 56px;
      }
    }

    .auth-alternate {
      margin-top: 20px;
      font-size: 13px;
    }
  }
}

@media (max-width: 380px) {
  .auth-page {
    padding-right: 16px;
    padding-left: 16px;

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

    .auth-card {
      padding: 22px 20px;

      .auth-title {
        font-size: 27px;
      }
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-page {
    .auth-back,
    .auth-form .auth-field input,
    .auth-form .auth-field textarea,
    .auth-form .auth-field select,
    .auth-form .auth-submit {
      transition: none;
    }
  }
}
